Search python libs exactly matching to python executable on cmake 2.8.9 and newer
authorAndrey Kamaev <no@email>
Sun, 24 Jun 2012 18:25:01 +0000 (18:25 +0000)
committerAndrey Kamaev <no@email>
Sun, 24 Jun 2012 18:25:01 +0000 (18:25 +0000)
cmake/OpenCVDetectPython.cmake

index e66410d..8be94ca 100644 (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)