Commit b2adc5d6 authored by jcfr's avatar jcfr

BUG: CMakeLists.txt - Set library path so that execute_process(python..) works

git-svn-id: http://svn.slicer.org/Slicer4/trunk@16822 3bd1e089-480b-0410-8dfb-8563597acbee
parent 3ecc29d2
......@@ -325,21 +325,6 @@ IF(BUILD_TESTING)
ENDIF()
#-----------------------------------------------------------------------------
# Python
#-----------------------------------------------------------------------------
IF(Slicer_USE_PYTHONQT)
FIND_PACKAGE(PythonLibs REQUIRED)
FIND_PACKAGE(PythonInterp REQUIRED)
EXECUTE_PROCESS(
COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print sys.version[:3]"
OUTPUT_VARIABLE Slicer_PYTHON_VERSION_DOT
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "[.]" "" Slicer_PYTHON_VERSION ${Slicer_PYTHON_VERSION_DOT})
ENDIF()
#-----------------------------------------------------------------------------
# ITK
#-----------------------------------------------------------------------------
......@@ -375,6 +360,27 @@ SET(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${CTK_CMAKE_UTILITIES_DIR})
#-----------------------------------------------------------------------------
# Set Slicer_PYTHON_VERSION and Slicer_PYTHON_VERSION_DOT
#-----------------------------------------------------------------------------
IF(Slicer_USE_PYTHONQT)
FIND_PACKAGE(PythonLibs REQUIRED)
FIND_PACKAGE(PythonInterp REQUIRED)
# Extract python lib path
get_filename_component(PYTHON_DIR_PATH ${PYTHON_EXECUTABLE} PATH)
SET(PYTHON_LIBRARY_PATH ${PYTHON_DIR_PATH}/../lib)
IF(WIN32)
SET(PYTHON_LIBRARY_PATH ${PYTHON_DIR_PATH})
ENDIF()
ctkMacroSetPaths("${PYTHON_LIBRARY_PATH}")
EXECUTE_PROCESS(
COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print sys.version[:3]"
OUTPUT_VARIABLE Slicer_PYTHON_VERSION_DOT
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "[.]" "" Slicer_PYTHON_VERSION ${Slicer_PYTHON_VERSION_DOT})
MESSAGE(STATUS "Configuring Slicer with python ${Slicer_PYTHON_VERSION_DOT}")
ENDIF()
#-----------------------------------------------------------------------------
# PythonQt
#-----------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment