Skip to content

Commit deeabfb

Browse files
authored
Use FindPython for CMake 3.27+ compatibility (#1088)
1 parent c98c904 commit deeabfb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@ if (BUILD_VERSION STREQUAL "0.0.0")
192192
file (STRINGS ${PROJECT_SOURCE_DIR}/VERSION_CURRENT BUILD_VERSION)
193193
message (STATUS "File VERSION_CURRENT contained BUILD_VERSION ${BUILD_VERSION}")
194194
else ()
195-
find_package (PythonInterp)
196-
if (PYTHONINTERP_FOUND)
195+
find_package (Python COMPONENTS Interpreter)
196+
if (TARGET Python::Interpreter)
197197
execute_process (
198-
COMMAND ${PYTHON_EXECUTABLE} etc/calc_release_version.py
198+
COMMAND "${Python_EXECUTABLE}" etc/calc_release_version.py
199199
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
200200
OUTPUT_VARIABLE CALC_RELEASE_VERSION
201201
RESULT_VARIABLE CALC_RELEASE_VERSION_RESULT

0 commit comments

Comments
 (0)