]> SALOME platform Git repositories - tools/libbatch.git/commitdiff
Salome HOME
Fix Python detection in non-system directories
authorbarate <barate>
Fri, 22 Mar 2013 09:51:22 +0000 (09:51 +0000)
committerbarate <barate>
Fri, 22 Mar 2013 09:51:22 +0000 (09:51 +0000)
CMakeLists.txt

index f671fce3c71b4d3ffbc9d772f2e2f116f9ed0567..e101c1f6e11e09f4d84c5dca8bf13dda286c08fe 100644 (file)
@@ -40,8 +40,12 @@ IF (BUILD_LOCAL_SUBMISSION)
 ENDIF (BUILD_LOCAL_SUBMISSION)
 IF (BUILD_PYTHON_WRAPPING)
     FIND_PACKAGE(PythonInterp)
-    SET(PythonLibs_FIND_VERSION ${PYTHON_VERSION_STRING})
-    FIND_PACKAGE(PythonLibs)
+    IF (PYTHONINTERP_FOUND)
+        get_filename_component(PYTHON_BIN_DIR "${PYTHON_EXECUTABLE}" PATH)
+        get_filename_component(CMAKE_INCLUDE_PATH "${PYTHON_BIN_DIR}/../include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" ABSOLUTE)
+        get_filename_component(CMAKE_LIBRARY_PATH "${PYTHON_BIN_DIR}/../lib" ABSOLUTE)
+    ENDIF (PYTHONINTERP_FOUND)
+    FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
     FIND_PACKAGE(SWIG)
 ENDIF (BUILD_PYTHON_WRAPPING)