| 123456789101112131415161718192021222324252627282930313233 | cmake_policy(SET CMP0190 NEW)enable_language(C)# Search for host Interpreterset(${PYTHON}_ARTIFACTS_PREFIX "_HOST")find_package(${PYTHON} ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter)unset(${PYTHON}_ARTIFACTS_PREFIX)# Search cross-compilation artifacts## First, built an pseudo-emulatorset(PSEUDO_EMULATOR_DIR "${CMAKE_CURRENT_BINARY_DIR}/pseudo_emulator")file(MAKE_DIRECTORY "${PSEUDO_EMULATOR_DIR}")execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE=Release                                           -S "${CMAKE_CURRENT_SOURCE_DIR}/pseudo_emulator"                                           -B "${PSEUDO_EMULATOR_DIR}"                COMMAND_ERROR_IS_FATAL ANY)execute_process(COMMAND "${CMAKE_COMMAND}" --build "${PSEUDO_EMULATOR_DIR}"                COMMAND_ERROR_IS_FATAL ANY)## Now, configure this pseudo-emulatorset(CMAKE_CROSSCOMPILING TRUE)set(CMAKE_CROSSCOMPILING_EMULATOR "${PSEUDO_EMULATOR_DIR}/pseudo_emulator")find_package(${PYTHON} ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter Development)
 |