Search python libs exactly matching to python executable on cmake 2.8.9 and newer

This commit is contained in:
Andrey Kamaev 2012-06-24 18:25:01 +00:00
parent 84d62b69dc
commit cfa9aa9206

View File

@ -30,7 +30,11 @@ if(PYTHON_EXECUTABLE)
endif()
if(NOT ANDROID AND NOT IOS)
find_host_package(PythonLibs ${PYTHON_VERSION_FULL})
if(CMAKE_VERSION VERSION_GREATER 2.8.8)
find_host_package(PythonLibs ${PYTHON_VERSION_FULL} EXACT)
else()
find_host_package(PythonLibs ${PYTHON_VERSION_FULL})
endif()
# cmake 2.4 (at least on Ubuntu 8.04 (hardy)) don't define PYTHONLIBS_FOUND
if(NOT PYTHONLIBS_FOUND AND PYTHON_INCLUDE_PATH)
set(PYTHONLIBS_FOUND ON)