From d4f2248879b93f1e6316fe07fbc72e6f7baf3900 Mon Sep 17 00:00:00 2001 From: prascle Date: Wed, 13 Feb 2013 17:27:02 +0000 Subject: [PATCH] PR: detect non native python with PYTHON_ROOT_DIR and LD_LIBRARY_PATH --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 -- 2.39.2