Commit 4c1a7fb0 authored by David Partyka's avatar David Partyka
Browse files

Merge branch 'install-python' into release

parents 927f240b 9520b2eb
......@@ -266,13 +266,26 @@ ENDIF(NOT VTK_INSTALL_JAVA_DIR)
# switch library installation on and off correctly we make the
# decision here.
SET(VTK_INSTALL_NO_LIBRARIES)
IF(NOT DEFINED VTK_INSTALL_DEVELOPMENT)
SET(VTK_INSTALL_DEVELOPMENT ON CACHE BOOL "Install headers, link libraries and other files used for development" FORCE )
ENDIF()
IF(NOT DEFINED VTK_INSTALL_NO_DEVELOPMENT)
IF(VTK_INSTALL_DEVELOPMENT)
SET(VTK_INSTALL_NO_DEVELOPMENT OFF)
ELSE()
SET(VTK_INSTALL_NO_DEVELOPMENT ON)
ENDIF()
ENDIF()
IF(BUILD_SHARED_LIBS)
IF(VTK_INSTALL_NO_RUNTIME AND VTK_INSTALL_NO_DEVELOPMENT)
SET(VTK_INSTALL_NO_LIBRARIES 1)
SET(VTK_INSTALL_NO_LIBRARIES ON)
ENDIF(VTK_INSTALL_NO_RUNTIME AND VTK_INSTALL_NO_DEVELOPMENT)
ELSE(BUILD_SHARED_LIBS)
IF(VTK_INSTALL_NO_DEVELOPMENT)
SET(VTK_INSTALL_NO_LIBRARIES 1)
SET(VTK_INSTALL_NO_LIBRARIES ON)
ENDIF(VTK_INSTALL_NO_DEVELOPMENT)
ENDIF(BUILD_SHARED_LIBS)
......@@ -1488,6 +1501,9 @@ IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
COMPONENT Development)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
# Install rules for fixing up vtkpython
ADD_SUBDIRECTORY(Utilities/Release)
# Setup CPack
INCLUDE(VTKCPack.cmake)
......
......@@ -16,7 +16,7 @@ TARGET_LINK_LIBRARIES(ParticleReader vtkHybrid)
SET(KIT IOExamples)
SET(MyTests TestDumpXMLFile.cxx TestParticleReader.cxx)
INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake)
INCLUDE(vtkTestingObjectFactory)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
......
......@@ -15,7 +15,7 @@ TARGET_LINK_LIBRARIES(ImageSlicing vtkRendering vtkImaging vtkIO)
SET(KIT ImageProcessingExamples)
SET(MyTests TestImageSlicing.cxx)
INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake)
INCLUDE(vtkTestingObjectFactory)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering vtkIO)
......
......@@ -29,7 +29,7 @@ ENDIF(VTK_USE_METAIO)
SET(KIT MedicalExamples)
SET(MyTests TestMedical1.cxx TestMedical2.cxx TestMedical3.cxx TestMedical4.cxx)
INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake)
INCLUDE(vtkTestingObjectFactory)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering vtkWidgets vtkVolumeRendering)
......
......@@ -21,7 +21,7 @@ TARGET_LINK_LIBRARIES(Delaunay3DAlpha vtkHybrid)
SET(KIT ModellingExamples)
SET(MyTests TestFinance.cxx TestDelaunay3D.cxx TestDelaunay3DAlpha.cxx)
INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake)
INCLUDE(vtkTestingObjectFactory)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
......
......@@ -24,7 +24,7 @@ SET(MyTests
TestBandedContours.cxx
)
INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake)
INCLUDE(vtkTestingObjectFactory)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkHybrid)
......
......@@ -21,7 +21,7 @@ TARGET_LINK_LIBRARIES(BalloonWidget vtkRendering vtkWidgets)
SET(KIT WidgetsExamples)
SET(MyTests TestSlider.cxx TestSlider2D.cxx TestBalloonWidget.cxx)
INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake)
INCLUDE(vtkTestingObjectFactory)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
......
......@@ -813,6 +813,12 @@ IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}
COMPONENT Development
)
INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/vtkTestingObjectFactory.cmake
DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24}/CMake
COMPONENT Development
)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
IF (VTK_WRAP_PYTHON AND VTK_USE_TK AND TK_FOUND)
......
......@@ -7,6 +7,11 @@
IF(NOT VTK_USE_FILE_INCLUDED)
SET(VTK_USE_FILE_INCLUDED 1)
# Update CMAKE_MODULE_PATH so includes work.
SET (CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${VTK_CMAKE_DIR})
# Load the compiler settings used for VTK.
IF(VTK_BUILD_SETTINGS_FILE AND NOT SKIP_VTK_BUILD_SETTINGS_FILE)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeImportBuildSettings.cmake)
......@@ -24,6 +29,6 @@ IF(NOT VTK_USE_FILE_INCLUDED)
INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
# Import the VTK_LOAD_CMAKE_EXTENSIONS macro.
INCLUDE(${VTK_CMAKE_DIR}/vtkMakeInstantiator.cmake)
INCLUDE(vtkMakeInstantiator)
ENDIF(NOT VTK_USE_FILE_INCLUDED)
#------------------------------------------------------------------------------
# Add install rules for required system runtimes such as MSVCRxx.dll
set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP ON)
include(InstallRequiredSystemLibraries)
if (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
DESTINATION ${VTK_INSTALL_BIN_DIR_CM24}
PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ
COMPONENT RuntimeLibraries)
if(VTK_WRAP_PYTHON)
# Install the runtimes to the lib dir as well since python modules are
# installed in that directory and the manifest files need to present there as
# well.
install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
DESTINATION ${VTK_INSTALL_LIB_DIR_CM24}/site-packages/vtk
PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ
COMPONENT RuntimeLibraries)
endif(VTK_WRAP_PYTHON)
endif (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
install(FILES ${VTK_SOURCE_DIR}/vtkLogo.ico
DESTINATION ${VTK_INSTALL_BIN_DIR_CM24}
PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ
COMPONENT RuntimeExecutables)
if(WIN32)
set(vtk_runtime_dir ${VTK_INSTALL_BIN_DIR_CM24})
else()
set(vtk_runtime_dir ${VTK_INSTALL_LIB_DIR_CM24})
endif()
# install core python distribution
if(NOT APPLE AND VTK_WRAP_PYTHON)
get_filename_component(PYTHON_BIN_DIR "${PYTHON_EXECUTABLE}" PATH)
get_filename_component(PYTHON_LIB_DIR "${PYTHON_LIBRARY}" PATH)
if(WIN32)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(standard_lib=1)"
OUTPUT_VARIABLE PYTHON_LIBS_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
file(GLOB python_core_modules "${PYTHON_BIN_DIR}/DLLs/*.pyd")
install(FILES ${python_core_modules}
DESTINATION ${VTK_INSTALL_BIN_DIR_CM24}
COMPONENT RuntimeLibraries)
else(WIN32)
get_filename_component(PYTHON_LIBS_DIR "${PYTHON_LIBRARY}" PATH)
file(TO_CMAKE_PATH ${PYTHON_LIBS_DIR} PYTHON_LIBS_DIR)
# install pyconfig.h
string(REGEX MATCH "python[0-9].[0-9]" py_inc_dir ${PYTHON_INCLUDE_DIR})
install(FILES ${PYTHON_INCLUDE_DIR}/pyconfig.h
DESTINATION ${vtk_runtime_dir}/include/${py_inc_dir}
COMPONENT RuntimeLibraries)
endif(WIN32)
file(TO_CMAKE_PATH ${PYTHON_LIBS_DIR} PYTHON_LIBS_DIR)
install(DIRECTORY ${PYTHON_LIBS_DIR}
DESTINATION ${vtk_runtime_dir}
USE_SOURCE_PERMISSIONS
COMPONENT RuntimeLibraries)
endif()
set(_dir "${VTK_INSTALL_LIB_DIR_CM24}")
if(WIN32)
set(_dir "bin")
endif(WIN32)
list(APPEND lib_search_dir "\${CMAKE_INSTALL_PREFIX}/bin" "\${CMAKE_INSTALL_PREFIX}/${VTK_INSTALL_LIB_DIR_CM24}")
list(APPEND lib_search_dir "${VTK_BINARY_DIR}/bin")
if(WIN32)
list(APPEND lib_search_dir "${VTK_BINARY_DIR}/bin/Release")
endif()
if(VTK_WRAP_TCL)
get_filename_component(TCL_BIN_DIR "${TCL_TCLSH}" PATH)
get_filename_component(TCL_LIB_DIR "${TCL_LIBRARY}" PATH)
get_filename_component(TK_LIB_DIR "${TK_LIBRARY}" PATH)
list(APPEND lib_search_dir ${TCL_BIN_DIR} ${TCL_BIN_DIR} ${TK_LIB_DIR})
endif()
if(VTK_WRAP_PYTHON)
list(APPEND lib_search_dir ${PYTHON_BIN_DIR} ${PYTHON_LIB_DIR})
if(WIN32)
list(APPEND lib_search_dir ${PYTHON_BIN_DIR}/DLLs)
endif()
endif()
set(APPS)
if(VTK_WRAP_PYTHON)
list(APPEND APPS "\${CMAKE_INSTALL_PREFIX}/${_dir}/vtkpython${CMAKE_EXECUTABLE_SUFFIX}") # paths to executables
endif()
if(VTK_WRAP_TCL)
#list(APPEND APPS "\${CMAKE_INSTALL_PREFIX}/${_dir}/vtk${CMAKE_EXECUTABLE_SUFFIX}")
endif()
install(CODE "
include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"${lib_names}\" \"${lib_search_dir}\")"
COMPONENT RuntimeLibraries)
......@@ -5,10 +5,13 @@
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
IF("${VTK_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
# For now, only build the CPack installer if vtk(.exe) will be available for
# For now, only build the CPack installer if vtk(.exe) or vtkpython will be available for
# installation:
#
IF(VTK_WRAP_TCL)
IF(VTK_WRAP_TCL OR VTK_WRAP_PYTHON)
# Disable component based installation.
set(CPACK_MONOLITHIC_INSTALL ON)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "VTK - The Visualization Toolkit")
SET(CPACK_PACKAGE_VENDOR "Kitware, Inc.")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
......@@ -16,16 +19,31 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
SET(CPACK_PACKAGE_VERSION_MAJOR "${VTK_MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${VTK_MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${VTK_BUILD_VERSION}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "VTK ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "VTK ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "vtk-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_PACKAGE_EXECUTABLES
"vtk" "VTK"
"vtkpython" "VTKPython"
)
# Set VTK Components to be installed
SET (CPACK_INSTALL_CMAKE_PROJECTS
"${VTK_BINARY_DIR}" "VTK Runtime Executables" "RuntimeExecutables" "/"
"${VTK_BINARY_DIR}" "VTK Runtime Libs" "RuntimeLibraries" "/"
)
# Append in CPACK rule for the Development Component
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
LIST(APPEND CPACK_INSTALL_CMAKE_PROJECTS
"${VTK_BINARY_DIR}" "VTK Development Headers, Libs and Tools" "Development" "/"
)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
IF(WIN32)
STRING(REGEX REPLACE "/" "\\\\\\\\" CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/Release/VTKInstall.bmp")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\vtk.exe")
set(CPACK_NSIS_MUI_ICON "${VTK_SOURCE_DIR}\\\\vtkLogo.ico")
set(CPACK_NSIS_MUI_UNIICON "${VTK_SOURCE_DIR}\\\\vtkLogo.ico")
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
SET(CPACK_NSIS_HELP_LINK "http://www.vtk.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
......@@ -33,7 +51,7 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
ENDIF(WIN32)
INCLUDE(CPack)
ENDIF(VTK_WRAP_TCL)
ENDIF(VTK_WRAP_TCL OR VTK_WRAP_PYTHON)
ENDIF("${VTK_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
......@@ -86,7 +86,7 @@ INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Python/vtkPythonAppInitConfigure.h.in
${VTK_BINARY_DIR}/Wrapping/Python/vtkPythonAppInitConfigure.h)
VTK_ADD_EXECUTABLE(vtkpython vtkPythonAppInit.cxx)
VTK_ADD_EXECUTABLE(vtkpython vtkPythonAppInit.cxx vtkpython.rc)
SET(VTKPYTHON_LINK_FLAGS)
SET(VTKPYTHON_LINK_LIBS)
......@@ -307,7 +307,6 @@ ENDIF (VTK_USE_PARALLEL AND VTK_USE_MPI)
IF(NOT VTK_INSTALL_NO_RUNTIME AND NOT VTK_INSTALL_NO_VTKPYTHON)
INSTALL(TARGETS vtkpython ${PVTKPYTHON_EXECUTABLE}
EXPORT ${VTK_INSTALL_EXPORT_NAME}
RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeExecutables # .exe, .dll
LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries # .so, mod.dll
ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development # .a, .lib
......@@ -558,9 +557,10 @@ IF(PYTHON_EXECUTABLE)
CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Python/PythonInstall.cmake.in
${VTK_BINARY_DIR}/Wrapping/Python/PythonInstall.cmake
@ONLY IMMEDIATE)
SET_TARGET_PROPERTIES(vtkpython_pyc PROPERTIES POST_INSTALL_SCRIPT
${VTK_BINARY_DIR}/Wrapping/Python/PythonInstall.cmake
)
install(SCRIPT ${VTK_BINARY_DIR}/Wrapping/Python/PythonInstall.cmake
COMPONENT RuntimeLibraries
)
ENDIF(NOT VTK_INSTALL_NO_PYTHON)
ENDIF(PYTHON_EXECUTABLE)
......
IDI_ICON1 ICON "../../vtkLogo.ico"
\ No newline at end of file
vtkLogo.ico

99.7 KB

Supports Markdown
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