mirror of
https://github.com/openbabel/openbabel.git
synced 2026-08-08 20:18:08 -05:00
Use Python Library version of the found Python Interpreter
If you have python2 at /usr/bin/python , but also have python3 libraries and header files installed, CMake will use the python2 interpreter, but the python3 libraries. This causes the python libraries found to have the same major and minor version as the interpreter.
This commit is contained in:
@@ -38,16 +38,20 @@ endif()
|
||||
|
||||
if (PYTHON_BINDINGS)
|
||||
if (EXISTS ${openbabel_SOURCE_DIR}/scripts/python/openbabel-python.cpp OR RUN_SWIG)
|
||||
find_package(PythonLibs)
|
||||
if (NOT PYTHONLIBS_FOUND)
|
||||
message(STATUS "Python libraries NOT found")
|
||||
endif (NOT PYTHONLIBS_FOUND)
|
||||
|
||||
find_package(PythonInterp)
|
||||
if (NOT PYTHONINTERP_FOUND)
|
||||
message(STATUS "Python interpreter NOT found")
|
||||
endif (NOT PYTHONINTERP_FOUND)
|
||||
|
||||
if (PYTHONINTERP_FOUND AND NOT Python_ADDITIONAL_VERSIONS)
|
||||
set(Python_ADDITIONAL_VERSIONS "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
|
||||
endif (PYTHONINTERP_FOUND AND NOT Python_ADDITIONAL_VERSIONS)
|
||||
|
||||
find_package(PythonLibs)
|
||||
if (NOT PYTHONLIBS_FOUND)
|
||||
message(STATUS "Python libraries NOT found")
|
||||
endif (NOT PYTHONLIBS_FOUND)
|
||||
|
||||
if(PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
|
||||
set(DO_PYTHON_BINDINGS ON BOOL)
|
||||
message(STATUS "Python bindings will be compiled")
|
||||
|
||||
Reference in New Issue
Block a user