Skip to content

Commit

Permalink
Use modern CMake syntax to find Python interpreter. Fixes issue#92
Browse files Browse the repository at this point in the history
  • Loading branch information
mpatrascoiu committed Mar 19, 2022
1 parent 350d679 commit 96fbb96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ project (davix)
#-------------------------------------------------------------------------------
# Find the python executable to use during the build
#-------------------------------------------------------------------------------
find_package(PythonInterp REQUIRED)
find_package(Python COMPONENTS Interpreter REQUIRED)

#-------------------------------------------------------------------------------
# Regenerate include/davix/features.hpp and version.cmake at _build_ time
#-------------------------------------------------------------------------------
add_custom_target(GenerateVersionInfo ALL DEPENDS Version)
add_custom_command(
OUTPUT Version
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/genversion.py --template include/davix/features.hpp.in --out include/davix/features.hpp
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/genversion.py --template version.cmake.in --out version.cmake
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/genversion.py --template include/davix/features.hpp.in --out include/davix/features.hpp
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/genversion.py --template version.cmake.in --out version.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

Expand All @@ -25,7 +25,7 @@ add_custom_command(
# only regenerates it at compile time.
#-------------------------------------------------------------------------------
execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/genversion.py --template version.cmake.in --out version.cmake
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/genversion.py --template version.cmake.in --out version.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

Expand Down

0 comments on commit 96fbb96

Please sign in to comment.