Skip to content

Commit

Permalink
CMake: update strategy for finding Python to allow building against a…
Browse files Browse the repository at this point in the history
… particular version
  • Loading branch information
selimnairb committed Aug 23, 2023
1 parent 247bc00 commit 15fc6c7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/swig/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
if(Python_LOOKUP_VERSION)
set(Python_FIND_STRATEGY VERSION)
find_package(Python ${Python_LOOKUP_VERSION} EXACT COMPONENTS Interpreter Development)
else()
set(Python_FIND_STRATEGY LOCATION)
find_package(Python3 COMPONENTS Interpreter Development)
endif()

include_directories(../..)

set_property(GLOBAL PROPERTY BAGPY_BINARY_DIR_PROP ${CMAKE_CURRENT_BINARY_DIR})
Expand Down

0 comments on commit 15fc6c7

Please sign in to comment.