Commit 197eaef1 authored by Brad King's avatar Brad King 💬
Browse files

ENH: VTKConfig.cmake and supporting files in the install tree now compute a...

ENH: VTKConfig.cmake and supporting files in the install tree now compute a VTK_INSTALL_PREFIX from VTK_DIR and report all paths using it.  This removes all hard-coded paths from VTK installations and allows them to be moved freely.
parent 4bf6c4fb
......@@ -17,7 +17,8 @@ MACRO(VTK_EXPORT_KIT kit ukit sources)
ENDFOREACH(src)
SET(VTK_EXPORT_KIT ${kit})
SET(VTK_EXPORT_UKIT ${ukit})
SET(VTK_EXPORT_HEADER_DIR ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR})
SET(VTK_EXPORT_KIT_DOLLAR "$")
SET(VTK_EXPORT_HEADER_DIR ${VTK_EXPORT_KIT_DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR})
CONFIGURE_FILE(${VTK_SOURCE_DIR}/CMake/vtkKit.cmake.in
${VTK_BINARY_DIR}/Utilities/InstallOnly/vtk${kit}Kit.cmake
@ONLY IMMEDIATE)
......
......@@ -4,7 +4,7 @@
#
# This file is configured by VTK and used by the UseVTK.cmake module
# to load VTK's settings for an external project.
@VTK_CONFIG_INSTALL_ONLY@
# The VTK include file directories.
SET(VTK_INCLUDE_DIRS "@VTK_INCLUDE_DIRS_CONFIG@")
......
......@@ -2,6 +2,10 @@
# one for installation. The file tells external projects how to use
# VTK.
# Help store a literal dollar in a string. CMake 2.2 allows escaped
# dollars but we have to support CMake 2.0.
SET(DOLLAR "$")
#-----------------------------------------------------------------------------
# Settings shared between the build tree and install tree.
......@@ -28,6 +32,9 @@ SET(VTK_MPI_SERVER_POSTFLAGS_CONFIG ${VTK_MPI_SERVER_POSTFLAGS})
#-----------------------------------------------------------------------------
# Settings specific to the build tree.
# The install-only section is empty for the build tree.
SET(VTK_CONFIG_INSTALL_ONLY)
# The "use" file.
SET(VTK_USE_FILE ${VTK_BINARY_DIR}/UseVTK.cmake)
......@@ -128,34 +135,34 @@ CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfig.cmake.in
# Settings specific to the install tree.
# The "use" file.
SET(VTK_USE_FILE ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/UseVTK.cmake)
SET(VTK_USE_FILE ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/UseVTK.cmake)
# The build settings file.
SET(VTK_BUILD_SETTINGS_FILE ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/VTKBuildSettings.cmake)
SET(VTK_BUILD_SETTINGS_FILE ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/VTKBuildSettings.cmake)
# The directory containing class list files for each kit.
SET(VTK_KITS_DIR_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR})
SET(VTK_KITS_DIR_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR})
# The wrapping hints file.
IF(VTK_WRAP_HINTS)
GET_FILENAME_COMPONENT(VTK_HINTS_FNAME ${VTK_WRAP_HINTS} NAME)
SET(VTK_WRAP_HINTS_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/${VTK_HINTS_FNAME})
SET(VTK_WRAP_HINTS_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/${VTK_HINTS_FNAME})
ENDIF(VTK_WRAP_HINTS)
# Include directories.
SET(VTK_INCLUDE_DIRS_CONFIG
${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR}
${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR}
${VTK_INCLUDE_DIRS_SYSTEM}
)
# Link directories.
SET(VTK_LIBRARY_DIRS_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_LIB_DIR})
SET(VTK_LIBRARY_DIRS_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_LIB_DIR})
# Runtime directories.
IF(WIN32)
SET(VTK_RUNTIME_DIRS_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR})
SET(VTK_RUNTIME_DIRS_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR})
ELSE(WIN32)
SET(VTK_RUNTIME_DIRS_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_LIB_DIR})
SET(VTK_RUNTIME_DIRS_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_LIB_DIR})
ENDIF(WIN32)
# Executable locations.
......@@ -169,29 +176,29 @@ SET(VTK_WRAP_TCL_EXE_CONFIG "")
SET(VTK_WRAP_TCL_INIT_EXE_CONFIG "")
SET(VTK_DOXYGEN_HOME_CONFIG "")
IF(VTK_WRAP_TCL)
SET(VTK_WRAP_TCL_EXE_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapTcl)
SET(VTK_WRAP_TCL_INIT_EXE_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapTclInit)
SET(VTK_TCL_HOME_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_TCL_DIR}/tcl)
SET(VTK_WRAP_TCL_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapTcl)
SET(VTK_WRAP_TCL_INIT_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapTclInit)
SET(VTK_TCL_HOME_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_TCL_DIR}/tcl)
ENDIF(VTK_WRAP_TCL)
IF(VTK_WRAP_PYTHON)
SET(VTK_WRAP_PYTHON_EXE_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapPython)
SET(VTK_WRAP_PYTHON_INIT_EXE_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapPythonInit)
SET(VTK_WRAP_PYTHON_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapPython)
SET(VTK_WRAP_PYTHON_INIT_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapPythonInit)
ENDIF(VTK_WRAP_PYTHON)
IF(VTK_WRAP_JAVA)
SET(VTK_PARSE_JAVA_EXE_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkParseJava)
SET(VTK_WRAP_JAVA_EXE_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapJava)
SET(VTK_JAVA_JAR_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_JAVA_DIR}/vtk.jar)
SET(VTK_PARSE_JAVA_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkParseJava)
SET(VTK_WRAP_JAVA_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapJava)
SET(VTK_JAVA_JAR_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_JAVA_DIR}/vtk.jar)
ENDIF(VTK_WRAP_JAVA)
# VTK style script locations.
SET(VTK_DOXYGEN_HOME_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_DOXYGEN_DIR})
SET(VTK_HEADER_TESTING_PY_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/testing/HeaderTesting.py)
SET(VTK_FIND_STRING_TCL_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/testing/FindString.tcl)
SET(VTK_PRINT_SELF_CHECK_TCL_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/testing/PrintSelfCheck.tcl)
SET(VTK_RT_IMAGE_TEST_TCL_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/testing/rtImageTest.tcl)
SET(VTK_DOXYGEN_HOME_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_DOXYGEN_DIR})
SET(VTK_HEADER_TESTING_PY_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/testing/HeaderTesting.py)
SET(VTK_FIND_STRING_TCL_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/testing/FindString.tcl)
SET(VTK_PRINT_SELF_CHECK_TCL_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/testing/PrintSelfCheck.tcl)
SET(VTK_RT_IMAGE_TEST_TCL_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/testing/rtImageTest.tcl)
IF(VTK_USE_PARALLEL)
SET(VTK_PRT_IMAGE_TEST_TCL_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/testing/prtImageTest.tcl)
SET(VTK_PRT_IMAGE_TEST_TCL_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/testing/prtImageTest.tcl)
ELSE(VTK_USE_PARALLEL)
SET(VTK_PRT_IMAGE_TEST_TCL_CONFIG "")
ENDIF(VTK_USE_PARALLEL)
......@@ -204,31 +211,48 @@ IF(VTK_RENDERING_NEED_TK_INTERNAL AND TK_INTERNAL_PATH)
IF("${TK_INTERNAL_PATH}" MATCHES
"Utilities/TclTk/internals/tk${TCL_TK_VERSION}")
SET(VTK_TK_INTERNAL_DIR_CONFIG
${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR}/TclTk/internals/${TCL_TK_VERSION})
${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR}/TclTk/internals/${TCL_TK_VERSION})
ENDIF("${TK_INTERNAL_PATH}" MATCHES
"Utilities/TclTk/internals/tk${TCL_TK_VERSION}")
ENDIF(VTK_RENDERING_NEED_TK_INTERNAL AND TK_INTERNAL_PATH)
SET(VTK_TK_INTERNAL_ROOT_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR})
SET(VTK_TK_INTERNAL_ROOT_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR})
# CMake extension module directory and macro file.
SET(VTK_LOAD_CMAKE_EXTENSIONS_MACRO_CONFIG
"${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/CMake/vtkLoadCMakeExtensions.cmake")
"${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/CMake/vtkLoadCMakeExtensions.cmake")
SET(VTK_CMAKE_DIR_CONFIG
"${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/CMake")
"${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/CMake")
SET(VTK_TCL_TK_MACROS_MODULE_CONFIG
"${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/CMake/vtkTclTkMacros.cmake")
SET(VTK_CMAKE_EXTENSIONS_DIR_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/CMake)
"${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/CMake/vtkTclTkMacros.cmake")
SET(VTK_CMAKE_EXTENSIONS_DIR_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/CMake)
# Library dependencies file.
SET(VTK_LIBRARY_DEPENDS_FILE "${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/VTKLibraryDepends.cmake")
SET(VTK_LIBRARY_DEPENDS_FILE "${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/VTKLibraryDepends.cmake")
# No backward compatibility hack needed for installed path
SET(VTK_CONFIG_BACKWARD_COMPATIBILITY_HACK)
#-----------------------------------------------------------------------------
# Configure VTKConfig.cmake for the install tree.
# Construct the proper number of GET_FILENAME_COMPONENT(... PATH)
# calls to compute the installation prefix from VTK_DIR.
STRING(REGEX REPLACE "/" ";" VTK_INSTALL_PACKAGE_DIR_COUNT
"${VTK_INSTALL_PACKAGE_DIR}")
SET(VTK_CONFIG_INSTALL_ONLY "
# Compute the installation prefix from VTK_DIR.
SET(VTK_INSTALL_PREFIX \"${DOLLAR}{VTK_DIR}\")
")
FOREACH(p ${VTK_INSTALL_PACKAGE_DIR_COUNT})
SET(VTK_CONFIG_INSTALL_ONLY
"${VTK_CONFIG_INSTALL_ONLY}GET_FILENAME_COMPONENT(VTK_INSTALL_PREFIX \"${DOLLAR}{VTK_INSTALL_PREFIX}\" PATH)\n"
)
ENDFOREACH(p)
# The install tree only has one configuration.
SET(VTK_CONFIGURATION_TYPES_CONFIG)
IF(CMAKE_CONFIGURATION_TYPES)
# There are multiple build configurations. Configure one
# VTKConfig.cmake for each configuration.
......@@ -242,7 +266,6 @@ IF(CMAKE_CONFIGURATION_TYPES)
# Install the config file corresponding to the build configuration
# specified when building the install target. The BUILD_TYPE variable
# will be set while CMake is processing the install files.
SET(DOLLAR "$")
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
INSTALL_FILES(${VTK_INSTALL_PACKAGE_DIR} FILES
${VTK_BINARY_DIR}/Utilities/${DOLLAR}{BUILD_TYPE}/VTKConfig.cmake)
......
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