# SPDX-License-Identifier: BSD-3-Clause # SPDX-FileCopyrightText: 2015 Aleix Pol Gonzalez # SPDX-FileCopyrightText: 2022 Harald Sitter include(FindPackageHandleStandardArgs) execute_process(COMMAND python3 -c "import @MODULE_NAME@" ERROR_VARIABLE ERRORS_OUTPUT OUTPUT_VARIABLE DISREGARD_VARIABLE RESULT_VARIABLE ExitCode TIMEOUT 30) if(ExitCode EQUAL 0) set(@GENMODULE@_FOUND TRUE) else() message(STATUS "python3 import failed for @MODULE_NAME@.") set(@GENMODULE@_FOUND FALSE) endif() find_package_handle_standard_args(@GENMODULE@ FOUND_VAR @GENMODULE@_FOUND REQUIRED_VARS @GENMODULE@_FOUND HANDLE_COMPONENTS )