]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: detect non native python with PYTHON_ROOT_DIR and LD_LIBRARY_PATH
authorprascle <prascle>
Wed, 13 Feb 2013 17:27:02 +0000 (17:27 +0000)
committerprascle <prascle>
Wed, 13 Feb 2013 17:27:02 +0000 (17:27 +0000)
CMakeLists.txt

index 4ac10ef561736a1dca4acca1564b7d286d4138ee..7bcd0b760d020223dd549bdd4dee8586051a30ef 100755 (executable)
@@ -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