From d387405a3c1e7bfe8d80dffe109d18b4a1b2041c Mon Sep 17 00:00:00 2001 From: Kristofer Jonsson Date: Thu, 25 Nov 2021 13:07:27 +0100 Subject: Use CMake to find Python 3 interpreter 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 --- cmake/helpers.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmake') 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 $ -d ${target}.d + COMMAND ${Python3_EXECUTABLE} ${SCRIPTS_DIR}/generate_binaries.py --output ./fw $ -d ${target}.d DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/${target}.d WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generate binaries for ${target}") -- cgit v1.2.1