From: prascle Date: Wed, 13 Feb 2013 17:27:02 +0000 (+0000) Subject: PR: detect non native python with PYTHON_ROOT_DIR and LD_LIBRARY_PATH X-Git-Tag: V6_main_FINAL~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d4f2248879b93f1e6316fe07fbc72e6f7baf3900;p=modules%2Fkernel.git PR: detect non native python with PYTHON_ROOT_DIR and LD_LIBRARY_PATH --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ac10ef56..7bcd0b760 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,9 +73,14 @@ if(EXISTS ${PYTHON_ROOT_DIR}) set(CMAKE_PROGRAM_PATH ${PYTHON_ROOT_DIR}/bin) endif(EXISTS ${PYTHON_ROOT_DIR}) find_package(PythonInterp REQUIRED) -# Set PythonLibs_FIND_VERSION To avoid problems when several versions are in the system -SET(PythonLibs_FIND_VERSION ${PYTHON_VERSION_STRING}) +if(EXISTS ${PYTHON_ROOT_DIR}) + set(PYTHON_INCLUDE_DIR ${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) + set(PYTHON_LIBRARY ${PYTHON_ROOT_DIR}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX}) +endif(EXISTS ${PYTHON_ROOT_DIR}) find_package(PythonLibs REQUIRED) +MESSAGE("Python includes : " ${PYTHON_INCLUDE_DIR}) +MESSAGE("Python library : " ${PYTHON_LIBRARY}) +MESSAGE("Python binary : " ${PYTHON_EXECUTABLE}) set(PYLOGLEVEL WARNING) # Swig