diff --git a/CMakeLists.txt b/CMakeLists.txt index 61f0cc5ea..65fdbc7cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,6 @@ if (MSVC) /MP /W2 /sdl - /Qspectre /guard:cf /FC /ZH:SHA_256 @@ -107,9 +106,9 @@ else () endif () endif () -find_program(PYTHON NAMES python3 python) +find_package(Python3 REQUIRED COMPONENTS Interpreter) execute_process( - COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/parse-version.m4.py ${CMAKE_CURRENT_SOURCE_DIR}/version.m4 + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/parse-version.m4.py ${CMAKE_CURRENT_SOURCE_DIR}/version.m4 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) include(${CMAKE_CURRENT_BINARY_DIR}/version.cmake) @@ -339,7 +338,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} src/compat include) add_custom_command( OUTPUT always_rebuild config-version.h - COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/git-version.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/git-version.py ) set(HAVE_CONFIG_VERSION_H YES)