Commit 1af3fad2 authored by Brad King's avatar Brad King 💬
Browse files

ENH: Adding VTK_RUNTIME_DIRS, VTK_CONFIGURATION_TYPES, and VTK_BUILD_TYPE...

ENH: Adding VTK_RUNTIME_DIRS, VTK_CONFIGURATION_TYPES, and VTK_BUILD_TYPE settings to VTKConfig.cmake.  These will help outside projects use VTK from both build and install trees with shared libraries and multiple build configurations.
parent b4f0d53f
......@@ -28,9 +28,6 @@ IF(VTK_USE_RENDERING)
ENDIF(VTK_USE_RENDERING)
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
# This is the installed VTKConfig.cmake file configured at the top
# level.
INSTALL_FILES(${VTK_INSTALL_PACKAGE_DIR} .cmake VTKConfig)
INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} .h
vtk_expat vtk_jpeg vtk_png vtk_zlib vtk_tiff vtk_freetype)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
......
......@@ -11,6 +11,12 @@ SET(VTK_INCLUDE_DIRS "@VTK_INCLUDE_DIRS_CONFIG@")
# The VTK library directories.
SET(VTK_LIBRARY_DIRS "@VTK_LIBRARY_DIRS_CONFIG@")
# The VTK runtime library directories. Note that if
# VTK_CONFIGURATION_TYPES is set (see below) then these directories
# will be the parent directories under which there will be a directory
# of runtime binaries for each configuration type.
SET(VTK_RUNTIME_DIRS "@VTK_RUNTIME_DIRS_CONFIG@")
# The C and C++ flags added by VTK to the cmake-configured flags.
SET(VTK_REQUIRED_C_FLAGS "@VTK_REQUIRED_C_FLAGS@")
SET(VTK_REQUIRED_CXX_FLAGS "@VTK_REQUIRED_CXX_FLAGS@")
......@@ -124,6 +130,20 @@ IF(VTK_USE_QVTK)
INCLUDE(${VTK_DIR}/VTKConfigQt.cmake)
ENDIF(VTK_USE_QVTK)
# A VTK install tree always provides one build configuration. A VTK
# build tree may provide either one or multiple build configurations
# depending on the CMake generator used. Since VTK can be used either
# from a build tree or an install tree it is useful for outside
# projects to know the configurations available. If this
# VTKConfig.cmake is in a VTK install tree VTK_CONFIGURATION_TYPES
# will be empty and VTK_BUILD_TYPE will be set to the value of
# CMAKE_BUILD_TYPE used to build VTK. If VTKConfig.cmake is in a VTK
# build tree then VTK_CONFIGURATION_TYPES and VTK_BUILD_TYPE will have
# values matching CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE for
# that build tree (only one will ever be set).
SET(VTK_CONFIGURATION_TYPES @VTK_CONFIGURATION_TYPES_CONFIG@)
SET(VTK_BUILD_TYPE @VTK_BUILD_TYPE_CONFIG@)
# The VTK library dependencies.
IF(NOT VTK_NO_LIBRARY_DEPENDS)
INCLUDE("@VTK_LIBRARY_DEPENDS_FILE@")
......
......@@ -3,7 +3,7 @@
# VTK.
#-----------------------------------------------------------------------------
# Settings shared between the build tres and install tree.
# Settings shared between the build tree and install tree.
IF(VTK_USE_MPI)
SET(VTK_MPIRUN_EXE_CONFIG ${VTK_MPIRUN_EXE})
......@@ -43,6 +43,9 @@ SET(VTK_WRAP_HINTS_CONFIG ${VTK_WRAP_HINTS})
# Library directory.
SET(VTK_LIBRARY_DIRS_CONFIG ${LIBRARY_OUTPUT_PATH})
# Runtime directory.
SET(VTK_RUNTIME_DIRS_CONFIG ${LIBRARY_OUTPUT_PATH})
# Determine the include directories needed.
SET(VTK_INCLUDE_DIRS_CONFIG
${VTK_INCLUDE_DIRS_BUILD_TREE}
......@@ -106,6 +109,10 @@ SET(VTK_CMAKE_EXTENSIONS_DIR_CONFIG ${VTK_BINARY_DIR}/CMake)
# Library dependencies file.
SET(VTK_LIBRARY_DEPENDS_FILE "${VTK_BINARY_DIR}/VTKLibraryDepends.cmake")
# Build configuration information.
SET(VTK_CONFIGURATION_TYPES_CONFIG ${CMAKE_CONFIGURATION_TYPES})
SET(VTK_BUILD_TYPE_CONFIG ${CMAKE_BUILD_TYPE})
# Hack to give source tree access for a build tree configuration.
STRING(ASCII 35 VTK_STRING_POUND)
STRING(ASCII 64 VTK_STRING_AT)
......@@ -144,6 +151,13 @@ SET(VTK_INCLUDE_DIRS_CONFIG
# Link directories.
SET(VTK_LIBRARY_DIRS_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_LIB_DIR})
# Runtime directories.
IF(WIN32)
SET(VTK_RUNTIME_DIRS_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR})
ELSE(WIN32)
SET(VTK_RUNTIME_DIRS_CONFIG ${CMAKE_INSTALL_PREFIX}${VTK_INSTALL_LIB_DIR})
ENDIF(WIN32)
# Executable locations.
SET(VTK_TCL_HOME_CONFIG "")
SET(VTK_JAVA_JAR_CONFIG "")
......@@ -214,5 +228,34 @@ SET(VTK_CONFIG_BACKWARD_COMPATIBILITY_HACK)
#-----------------------------------------------------------------------------
# Configure VTKConfig.cmake for the install tree.
CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfig.cmake.in
${VTK_BINARY_DIR}/Utilities/VTKConfig.cmake @ONLY IMMEDIATE)
SET(VTK_CONFIGURATION_TYPES_CONFIG)
IF(CMAKE_CONFIGURATION_TYPES)
# There are multiple build configurations. Configure one
# VTKConfig.cmake for each configuration.
FOREACH(config ${CMAKE_CONFIGURATION_TYPES})
SET(VTK_BUILD_TYPE_CONFIG ${config})
CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfig.cmake.in
${VTK_BINARY_DIR}/Utilities/${config}/VTKConfig.cmake
@ONLY IMMEDIATE)
ENDFOREACH(config)
# 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)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
ELSE(CMAKE_CONFIGURATION_TYPES)
# There is only one build configuration. Configure one VTKConfig.cmake.
SET(VTK_BUILD_TYPE_CONFIG ${CMAKE_BUILD_TYPE})
CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfig.cmake.in
${VTK_BINARY_DIR}/Utilities/VTKConfig.cmake @ONLY IMMEDIATE)
# Setup an install rule for the config file.
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
INSTALL_FILES(${VTK_INSTALL_PACKAGE_DIR} FILES
${VTK_BINARY_DIR}/Utilities/VTKConfig.cmake)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
ENDIF(CMAKE_CONFIGURATION_TYPES)
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