Commit 7e9285a4 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'fix-python-installation'

f131aecb smtk: improve comment for include file step
05bdca46 shiboken: install to the generic library path
3d311645 smtk: fix python module paths
92837883 smtk: use cmake commands rather than execute_process
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !75
parents 7b4ff99c f131aecb
......@@ -2,18 +2,21 @@
#We only have to do this special installation of the smtk libraries as a plugin
#on MAC
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${TMP_DIR}/SMTKPlugin)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TMP_DIR}/SMTKPlugin)
file(REMOVE_RECURSE "${TMP_DIR}/SMTKPlugin")
file(MAKE_DIRECTORY "${TMP_DIR}/SMTKPlugin")
set(plugin_install_dir ${INSTALL_DIR}/Applications/ModelBuilder.app/Contents/Python/smtk)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${plugin_install_dir})
file(MAKE_DIRECTORY "${plugin_install_dir}")
set(py_files_libs ${SMTK_BIN_DIR}/lib/SMTKCorePython.so
set(py_files_libs ${SMTK_BIN_DIR}/lib/python${PYTHON_VERSION}/site-packages/smtk/SMTKCorePython.so
${SMTK_BIN_DIR}/lib/libshiboken-python${PYTHON_VERSION}.1.2.dylib
${SMTK_BIN_DIR}/lib/python${PYTHON_VERSION}/site-packages/shiboken.so
${SMTK_BIN_DIR}/libexec/python/site-packages/smtk/simple.py)
foreach(lib ${py_files_libs})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${lib} ${TMP_DIR}/SMTKPlugin)
${SMTK_BIN_DIR}/lib/python${PYTHON_VERSION}/site-packages/smtk/simple.py)
foreach(lib IN LISTS py_files_libs)
configure_file(
"${lib}"
"${TMP_DIR}/SMTKPlugin"
COPYONLY)
endforeach()
execute_process(
......@@ -26,13 +29,16 @@ execute_process(
execute_process(
COMMAND ${CMAKE_CURRENT_LIST_DIR}/../remove_code.py
${SMTK_BIN_DIR}/libexec/python/site-packages/smtk/__init__.py
${SMTK_BIN_DIR}/lib/python${PYTHON_VERSION}/site-packages/smtk/__init__.py
${TMP_DIR}/SMTKPlugin/__init__.py
)
#okay the plugin is fixed up, now we need to install it into paraviews bundle
file(GLOB fixedUpLibs "${TMP_DIR}/SMTKPlugin/*")
foreach(lib ${fixedUpLibs})
foreach(lib IN LISTS fixedUpLibs)
message(STATUS "Installing plugin: ${lib}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${lib} ${plugin_install_dir})
configure_file(
"${lib}"
"${plugin_install_dir}"
COPYONLY)
endforeach()
......@@ -32,7 +32,7 @@ STRING(REGEX REPLACE ".*/libpython([0-9\\.]+)\\.dylib" "\\1" PYTHON_VERSION "${P
if(shiboken_ENABLED)
add_external_project_step(install_shiboken_python_plugin
COMMENT "Fixing missing include files."
COMMENT "smtk: fixing missing include files"
COMMAND ${CMAKE_COMMAND}
-DBUILD_SHARED_LIBS:BOOL=ON
......
......@@ -20,24 +20,24 @@ elseif (WIN32)
set (LIB_SHIBOKEN_PY "bin/shiboken-python2.7.dll")
endif()
file(REMOVE_RECURSE ${TMP_DIR}/SMTKPlugin)
file(MAKE_DIRECTORY ${TMP_DIR}/SMTKPlugin)
file(REMOVE_RECURSE "${TMP_DIR}/SMTKPlugin")
file(MAKE_DIRECTORY "${TMP_DIR}/SMTKPlugin")
set(plugin_install_dir ${SMTK_BIN_DIR}/${PYTHON_INSTALL}/smtk)
file(MAKE_DIRECTORY ${plugin_install_dir})
file(MAKE_DIRECTORY "${plugin_install_dir}")
if (UNIX)
set(PYTHON_COPY_SOURCE_LOC ${CMAKE_INSTALL_LIBEXECDIR}/python/site-packages)
set(PYTHON_COPY_SOURCE_LOC lib/python2.7/site-packages)
elseif (WIN32)
set(PYTHON_COPY_SOURCE_LOC bin/Lib/site-packages)
endif()
set(py_files_libs ${SMTK_BIN_DIR}/lib/smtkCorePython.${SHARED_LIBRARY_SUFFIX}
set(py_files_libs ${SMTK_BIN_DIR}/${PYTHON_SITE}/smtk/smtkCorePython.${SHARED_LIBRARY_SUFFIX}
${SMTK_BIN_DIR}/${LIB_SHIBOKEN_PY}
${SMTK_BIN_DIR}/${PYTHON_SITE}/shiboken.${SHARED_LIBRARY_SUFFIX}
${SMTK_BIN_DIR}/${PYTHON_COPY_SOURCE_LOC}/smtk/simple.py)
foreach(lib ${py_files_libs})
configure_file(${lib} ${TMP_DIR}/SMTKPlugin COPYONLY)
foreach(lib IN LISTS py_files_libs)
configure_file("${lib}" "${TMP_DIR}/SMTKPlugin" COPYONLY)
endforeach()
execute_process(
......@@ -48,15 +48,15 @@ execute_process(
#okay the plugin is fixed up, now we need to install it into paraviews bundle
file(GLOB fixedUpLibs "${TMP_DIR}/SMTKPlugin/*")
foreach(lib ${fixedUpLibs})
configure_file(${lib} ${plugin_install_dir} COPYONLY)
foreach(lib IN LISTS fixedUpLibs)
configure_file("${lib}" "${plugin_install_dir}" COPYONLY)
endforeach()
# For linux, also copy smtk libs where standalone export app can find them
if (UNIX)
set(STANDALONE_EXPORT_DIR ${SMTK_BIN_DIR}/${PYTHON_SITE}/smtk)
file(MAKE_DIRECTORY "${STANDALONE_EXPORT_DIR}")
foreach(lib ${fixedUpLibs})
configure_file(${lib} ${STANDALONE_EXPORT_DIR} COPYONLY)
foreach(lib IN LISTS fixedUpLibs)
configure_file("${lib}" "${STANDALONE_EXPORT_DIR}" COPYONLY)
endforeach()
endif()
set(shiboken_args)
if (UNIX)
list(APPEND shiboken_args
-DPYTHON_SITE_PACKAGES:STRING=lib/python2.7/site-packages)
endif ()
add_external_project(shiboken
DEPENDS qt python
CMAKE_ARGS
......@@ -5,5 +11,6 @@ add_external_project(shiboken
-DSET_RPATH:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=ON
-DDISABLE_DOCSTRINGS:BOOL=ON
-DBUILD_TESTS:BOOL=OFF
-DBUILD_TESTS:BOOL=OFF
${shiboken_args}
)
......@@ -52,7 +52,7 @@ add_external_project_or_just_build_dependencies(smtk
if(shiboken_ENABLED)
add_external_project_step(install_shiboken_python_plugin
COMMENT "Fixing missing include files."
COMMENT "smtk: fixing missing include files"
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-Dpv_version:STRING=${pv_version}
......
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