From: barate Date: Fri, 22 Mar 2013 09:51:22 +0000 (+0000) Subject: Fix Python detection in non-system directories X-Git-Tag: V2_0_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=889d5316c5641760559888ecd6f630747b8ba8af;p=tools%2Flibbatch.git Fix Python detection in non-system directories --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f671fce..e101c1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)