Skip to content

Commit

Permalink
fix: Allow for custom python executable
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick96 committed Oct 22, 2023
1 parent ebd834d commit a8b9e68
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ pkg_check_modules(XCBPROTO REQUIRED xcb-proto)
# Store the location of the proto xml files inside XCBPROTO_XCBINCLUDEDIR
pkg_get_variable(XCBPROTO_XCBINCLUDEDIR xcb-proto xcbincludedir)

if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
find_package(PythonInterp 3.5 REQUIRED)
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter)
if(Python3_FOUND)
set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}")
# Search for a python interpreter, if the user didn't specify any
if(NOT PYTHON_EXECUTABLE)
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
find_package(PythonInterp 3.5 REQUIRED)
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter)
if(Python3_FOUND)
set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}")
endif()
endif()
endif()

Expand Down

0 comments on commit a8b9e68

Please sign in to comment.