From 7455e5890e3b2db4e4c2d6370017a2e149e92a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Gr=C3=A9goire?= Date: Sat, 8 Mar 2025 16:37:09 +0100 Subject: [PATCH] Let CMake discover python3 and make it required since it is effectively needed to build This gives a better error message and helps finding the correct python executable since python3 may actually be only named python on windows for example. --- profiler/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profiler/CMakeLists.txt b/profiler/CMakeLists.txt index 8a148d1b..a9f1d3d0 100644 --- a/profiler/CMakeLists.txt +++ b/profiler/CMakeLists.txt @@ -189,8 +189,9 @@ if(NOT DEFINED GIT_REV) set(GIT_REV "HEAD") endif() +find_package(Python3 COMPONENTS Interpreter REQUIRED) add_custom_target(git-ref - COMMAND python3 ${CMAKE_CURRENT_LIST_DIR}/../extra/git-ref.py ${GIT_REV} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/../extra/git-ref.py ${GIT_REV} BYPRODUCTS GitRef.hpp ) add_dependencies(${PROJECT_NAME} git-ref)