mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
CMake: Use CMake 3.12 FindPython, where available
This commit is contained in:
parent
0997c6b19c
commit
10b5c9f3e6
@ -5,16 +5,25 @@
|
||||
set(WANT_PYTHON_VERSION ""
|
||||
CACHE STRING "Which Python version to seek out for building Panda3D against.")
|
||||
|
||||
find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET)
|
||||
find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET)
|
||||
find_package(Python ${WANT_PYTHON_VERSION} QUIET COMPONENTS Interpreter Development)
|
||||
|
||||
if(PYTHONLIBS_FOUND)
|
||||
if(Python_FOUND)
|
||||
set(PYTHON_FOUND ON)
|
||||
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
|
||||
else()
|
||||
find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET)
|
||||
find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET)
|
||||
|
||||
if(PYTHONLIBS_FOUND)
|
||||
set(PYTHON_FOUND ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
package_option(PYTHON DEFAULT ON
|
||||
package_option(PYTHON
|
||||
DEFAULT ON
|
||||
"Enables support for Python. If INTERROGATE_PYTHON_INTERFACE
|
||||
is also enabled, Python bindings will be generated.")
|
||||
is also enabled, Python bindings will be generated."
|
||||
IMPORTED_AS Python::Python)
|
||||
|
||||
# Also detect the optimal install paths:
|
||||
if(HAVE_PYTHON)
|
||||
|
Loading…
x
Reference in New Issue
Block a user