Skip to content

Commit

Permalink
Search for Python3 interpreter but keep libraries mandatory
Browse files Browse the repository at this point in the history
Signed-off-by: Bi0T1N <[email protected]>
  • Loading branch information
Bi0T1N committed Aug 19, 2023
1 parent 2b82268 commit b1f2cbb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,16 @@ else()
# the code below can be removed; e.g. pybind needs Interpreter and Development components
# see https://pybind11.readthedocs.io/en/stable/cmake/index.html#new-findpython-mode
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
find_package(PythonLibs QUIET)
set(Python3_FOUND ${PYTHONLIBS_FOUND})
set(Python3_VERSION ${PYTHONLIBS_VERSION_STRING})
find_package(PythonInterp ${IGN_PYTHON_VERSION} QUIET)
if(PYTHONINTERP_FOUND)
set(Python3_FOUND ${PYTHONINTERP_FOUND})
set(Python3_Interpreter_FOUND ${PYTHONINTERP_FOUND})
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
find_package(PythonLibs QUIET)
# we found the interpreter but did we also find the libs? both are required
set(Python3_FOUND ${PYTHONLIBS_FOUND})
set(Python3_VERSION ${PYTHONLIBS_VERSION_STRING})
endif()
else()
find_package(Python3 QUIET COMPONENTS Interpreter Development)
endif()
Expand Down

0 comments on commit b1f2cbb

Please sign in to comment.