diff options
author | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2021-11-25 13:07:27 +0100 |
---|---|---|
committer | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2021-11-25 15:31:56 +0100 |
commit | d387405a3c1e7bfe8d80dffe109d18b4a1b2041c (patch) | |
tree | 3c7967cc58c394dc0562d9470f72d75adc5ca374 | |
parent | 15625f17e4c5f71be970cda8bf918cc00e613cad (diff) | |
download | ethos-u-core-platform-d387405a3c1e7bfe8d80dffe109d18b4a1b2041c.tar.gz |
Use CMake to find Python 3 interpreter21.11-rc3
The name of the Python 3 interpreter is ambiguous. 'python3' is not
available on all systems and 'python' can be both a Python 2 and
Python 3 interpreter.
Change-Id: I4ea119c617d1746fd34ecdd118a7c25dfe17dc86
-rw-r--r-- | cmake/helpers.cmake | 5 | ||||
-rw-r--r-- | targets/corstone-300/CMakeLists.txt | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/cmake/helpers.cmake b/cmake/helpers.cmake index 11c57d0..c8a4987 100644 --- a/cmake/helpers.cmake +++ b/cmake/helpers.cmake @@ -143,11 +143,14 @@ endfunction() # Generate binaries ############################################################################# +set(Python3_FIND_STRATEGY LOCATION) +find_package(Python3 COMPONENTS Interpreter) + function(ethosu_add_binaries target) set(SCRIPTS_DIR ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../scripts) add_custom_command(TARGET ${target} POST_BUILD - COMMAND ${SCRIPTS_DIR}/generate_binaries.py --output ./fw $<TARGET_FILE:${target}> -d ${target}.d + COMMAND ${Python3_EXECUTABLE} ${SCRIPTS_DIR}/generate_binaries.py --output ./fw $<TARGET_FILE:${target}> -d ${target}.d DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/${target}.d WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generate binaries for ${target}") diff --git a/targets/corstone-300/CMakeLists.txt b/targets/corstone-300/CMakeLists.txt index 9d5ce26..d2e3322 100644 --- a/targets/corstone-300/CMakeLists.txt +++ b/targets/corstone-300/CMakeLists.txt @@ -26,7 +26,10 @@ if (NOT CMAKE_TOOLCHAIN_FILE) set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/toolchain/armclang.cmake") endif() -set(ETHOSU_COMMAND_DEFAULT python3 ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/run_ctest.py -t corstone-300 CACHE INTERNAL "Default test command") +set(Python3_FIND_STRATEGY LOCATION) +find_package(Python3 COMPONENTS Interpreter) + +set(ETHOSU_COMMAND_DEFAULT ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/run_ctest.py -t corstone-300 CACHE INTERNAL "Default test command") ############################################################################# # Project |