vtkGenerateVTKConfig.cmake 16.5 KB
Newer Older
1 2 3 4
# Generate the VTKConfig.cmake file in the build tree.  Also configure
# one for installation.  The file tells external projects how to use
# VTK.

5 6 7 8 9 10 11 12 13 14 15 16 17
# Construct version numbers for VTKConfigVersion.cmake.
SET(_VTK_VERSION_MAJOR ${VTK_MAJOR_VERSION})
SET(_VTK_VERSION_MINOR ${VTK_MINOR_VERSION})
SET(_VTK_VERSION_PATCH ${VTK_BUILD_VERSION})
# We use odd minor numbers for development versions.
# Use a date for the development patch level.
IF("${_VTK_VERSION_MINOR}" MATCHES "[13579]$")
  INCLUDE(${VTK_SOURCE_DIR}/Utilities/kwsys/kwsysDateStamp.cmake)
  SET(_VTK_VERSION_PATCH
    "${KWSYS_DATE_STAMP_YEAR}${KWSYS_DATE_STAMP_MONTH}${KWSYS_DATE_STAMP_DAY}"
    )
ENDIF("${_VTK_VERSION_MINOR}" MATCHES "[13579]$")

18 19 20 21
# Help store a literal dollar in a string.  CMake 2.2 allows escaped
# dollars but we have to support CMake 2.0.
SET(DOLLAR "$")

22 23 24
# Make sure all of the Tcl/Tk macros are loaded.
INCLUDE(${VTK_SOURCE_DIR}/CMake/vtkTclTkMacros.cmake)

25
#-----------------------------------------------------------------------------
26
# Settings shared between the build tree and install tree.
27

28
IF(VTK_USE_MPI)
29
  SET(VTK_MPIRUN_EXE_CONFIG ${VTK_MPIRUN_EXE})
30
  SET(VTK_MPI_PRENUMPROC_FLAGS_CONFIG ${VTK_MPI_PRENUMPROC_FLAGS})
31
  SET(VTK_MPI_NUMPROC_FLAG_CONFIG ${VTK_MPI_NUMPROC_FLAG})
32 33 34
  SET(VTK_MPI_MAX_NUMPROCS_CONFIG ${VTK_MPI_MAX_NUMPROCS})
  SET(VTK_MPI_POSTFLAGS_CONFIG ${VTK_MPI_POSTFLAGS})
  SET(VTK_MPI_PREFLAGS_CONFIG ${VTK_MPI_PREFLAGS})
35 36
  SET(VTK_MPI_CLIENT_PREFLAGS_CONFIG ${VTK_MPI_CLIENT_PREFLAGS})
  SET(VTK_MPI_SERVER_PREFLAGS_CONFIG ${VTK_MPI_SERVER_PREFLAGS})
37 38
ELSE(VTK_USE_MPI)
  SET(VTK_MPIRUN_EXE_CONFIG "")
39
  SET(VTK_MPI_NUMPROC_FLAG_CONFIG "")
40 41 42
  SET(VTK_MPI_MAX_NUMPROCS_CONFIG "")
  SET(VTK_MPI_POSTFLAGS_CONFIG "")
  SET(VTK_MPI_PREFLAGS_CONFIG "")
43 44
  SET(VTK_MPI_CLIENT_PREFLAGS_CONFIG "")
  SET(VTK_MPI_SERVER_PREFLAGS_CONFIG "")
45 46
ENDIF(VTK_USE_MPI)

47 48 49 50
# Some setting for the remote testing
SET(VTK_MPI_CLIENT_POSTFLAGS_CONFIG ${VTK_MPI_CLIENT_POSTFLAGS})
SET(VTK_MPI_SERVER_POSTFLAGS_CONFIG ${VTK_MPI_SERVER_POSTFLAGS})

51 52 53
#-----------------------------------------------------------------------------
# Settings specific to the build tree.

54 55 56
# The install-only section is empty for the build tree.
SET(VTK_CONFIG_INSTALL_ONLY)

57 58 59
# The "use" file.
SET(VTK_USE_FILE ${VTK_BINARY_DIR}/UseVTK.cmake)

Brad King's avatar
Brad King committed
60
# The build settings file.
61
SET(VTK_BUILD_SETTINGS_FILE ${VTK_BINARY_DIR}/VTKBuildSettings.cmake)
Brad King's avatar
Brad King committed
62

63 64 65
# The directory containing class list files for each kit.
SET(VTK_KITS_DIR_CONFIG ${VTK_BINARY_DIR}/Utilities)

66 67 68
# The wrapping hints file.
SET(VTK_WRAP_HINTS_CONFIG ${VTK_WRAP_HINTS})

69
# Library directory.
70
SET(VTK_LIBRARY_DIRS_CONFIG ${LIBRARY_OUTPUT_PATH})
71

72
# Runtime library directory.
73
SET(VTK_RUNTIME_LIBRARY_DIRS_CONFIG ${LIBRARY_OUTPUT_PATH})
74

75 76 77
# Binary executable directory.
SET(VTK_EXECUTABLE_DIRS_CONFIG ${EXECUTABLE_OUTPUT_PATH})

78
# Determine the include directories needed.
Brad King's avatar
Brad King committed
79 80 81 82 83
SET(VTK_INCLUDE_DIRS_CONFIG
  ${VTK_INCLUDE_DIRS_BUILD_TREE}
  ${VTK_INCLUDE_DIRS_SOURCE_TREE}
  ${VTK_INCLUDE_DIRS_SYSTEM}
)
84 85

# Executable locations.
86
SET(VTK_TCL_HOME_CONFIG "")
87
SET(VTK_PYTHONPATH_DIRS_CONFIG "")
88
SET(VTK_JAVA_JAR_CONFIG "")
89 90 91
SET(VTK_PARSE_JAVA_EXE_CONFIG "")
SET(VTK_WRAP_JAVA_EXE_CONFIG "")
SET(VTK_WRAP_PYTHON_EXE_CONFIG "")
92
SET(VTK_WRAP_PYTHON_INIT_EXE_CONFIG "")
93
SET(VTK_WRAP_TCL_EXE_CONFIG "")
94
SET(VTK_WRAP_TCL_INIT_EXE_CONFIG "")
95 96
IF(VTK_WRAP_TCL)
  SET(VTK_WRAP_TCL_EXE_CONFIG ${VTK_WRAP_TCL_EXE})
97
  SET(VTK_WRAP_TCL_INIT_EXE_CONFIG ${VTK_WRAP_TCL_INIT_EXE})
98
  SET(VTK_TCL_HOME_CONFIG ${VTK_TCL_HOME})
99 100
ENDIF(VTK_WRAP_TCL)
IF(VTK_WRAP_PYTHON)
101
  SET(VTK_PYTHONPATH_DIRS_CONFIG ${VTK_BINARY_DIR}/Wrapping/Python ${LIBRARY_OUTPUT_PATH})
102
  SET(VTK_WRAP_PYTHON_EXE_CONFIG ${VTK_WRAP_PYTHON_EXE})
103
  SET(VTK_WRAP_PYTHON_INIT_EXE_CONFIG ${VTK_WRAP_PYTHON_INIT_EXE})
104 105 106 107
ENDIF(VTK_WRAP_PYTHON)
IF(VTK_WRAP_JAVA)
  SET(VTK_PARSE_JAVA_EXE_CONFIG ${VTK_PARSE_JAVA_EXE})
  SET(VTK_WRAP_JAVA_EXE_CONFIG ${VTK_WRAP_JAVA_EXE})
108
  SET(VTK_JAVA_JAR_CONFIG ${LIBRARY_OUTPUT_PATH}/vtk.jar)
109
ENDIF(VTK_WRAP_JAVA)
Sebastien Barre's avatar
Sebastien Barre committed
110
SET(VTK_ENCODESTRING_EXE_CONFIG ${VTK_ENCODESTRING_EXE})
111 112

# VTK style script locations.
113
SET(VTK_DOXYGEN_HOME_CONFIG ${VTK_SOURCE_DIR}/Utilities/Doxygen)
114 115
SET(VTK_HEADER_TESTING_PY_CONFIG ${VTK_SOURCE_DIR}/Common/Testing/HeaderTesting.py)
SET(VTK_FIND_STRING_TCL_CONFIG ${VTK_SOURCE_DIR}/Common/Testing/Tcl/FindString.tcl)
116 117
SET(VTK_PRINT_SELF_CHECK_TCL_CONFIG ${VTK_SOURCE_DIR}/Common/Testing/Tcl/PrintSelfCheck.tcl)
SET(VTK_RT_IMAGE_TEST_TCL_CONFIG ${VTK_SOURCE_DIR}/Common/Testing/Tcl/rtImageTest.tcl)
118 119

IF(VTK_USE_PARALLEL)
120
  SET(VTK_PRT_IMAGE_TEST_TCL_CONFIG ${VTK_SOURCE_DIR}/Common/Testing/Tcl/prtImageTest.tcl)
121
ELSE(VTK_USE_PARALLEL)
122
  SET(VTK_PRT_IMAGE_TEST_TCL_CONFIG "")
123
ENDIF(VTK_USE_PARALLEL)
124

125
# Location of tk internal headers and resources provided by VTK.
126
SET(VTK_TK_INTERNAL_DIR_CONFIG "${TK_INTERNAL_PATH}")
127

128 129 130 131 132 133 134 135 136 137
# The resources dir is only worth exporting if we are building with
# Tcl/Tk static
SET(VTK_TK_RESOURCES_DIR_CONFIG "")
IF(VTK_USE_TK AND VTK_TCL_TK_STATIC)
  SET(VTK_TK_RESOURCES_DIR_CONFIG ${VTK_TK_RESOURCES_DIR})
ENDIF(VTK_USE_TK AND VTK_TCL_TK_STATIC)

SET(VTK_TCL_SUPPORT_LIBRARY_PATH_CONFIG ${VTK_TCL_SUPPORT_LIBRARY_PATH})
SET(VTK_TK_SUPPORT_LIBRARY_PATH_CONFIG ${VTK_TK_SUPPORT_LIBRARY_PATH})

138
# CMake extension module directory.
139
SET(VTK_LOAD_CMAKE_EXTENSIONS_MACRO_CONFIG
140
    "${VTK_CMAKE_DIR}/vtkLoadCMakeExtensions.cmake")
Ken Martin's avatar
Ken Martin committed
141
SET(VTK_CMAKE_DIR_CONFIG
142
    "${VTK_CMAKE_DIR}")
143
SET(VTK_TCL_TK_MACROS_MODULE_CONFIG
144
    "${VTK_CMAKE_DIR}/vtkTclTkMacros.cmake")
145
SET(VTK_CMAKE_EXTENSIONS_DIR_CONFIG ${VTK_BINARY_DIR}/CMake)
146

147 148 149
# Library dependencies file.
SET(VTK_LIBRARY_DEPENDS_FILE "${VTK_BINARY_DIR}/VTKLibraryDepends.cmake")

150 151 152 153
# Build configuration information.
SET(VTK_CONFIGURATION_TYPES_CONFIG ${CMAKE_CONFIGURATION_TYPES})
SET(VTK_BUILD_TYPE_CONFIG ${CMAKE_BUILD_TYPE})

Andy Cedilnik's avatar
Andy Cedilnik committed
154 155 156 157 158 159
# Hack to give source tree access for a build tree configuration.
STRING(ASCII 35 VTK_STRING_POUND)
STRING(ASCII 64 VTK_STRING_AT)
SET(VTK_CONFIG_BACKWARD_COMPATIBILITY_HACK
  "\n${VTK_STRING_POUND} For backward compatability.  DO NOT USE.\nSET(VTK_SOURCE_DIR \"${VTK_SOURCE_DIR}\")\nIF(NOT TCL_LIBRARY)\n  SET(TCL_LIBRARY \"${TCL_LIBRARY}\" CACHE FILEPATH \"Location of Tcl library imported from VTK.  This may mean your project is depending on VTK to get this setting.  Consider using FindTCL.cmake.\")\nENDIF(NOT TCL_LIBRARY)\nIF(NOT TK_LIBRARY)\n  SET(TK_LIBRARY \"${TK_LIBRARY}\" CACHE FILEPATH \"Location of Tk library imported from VTK.  This may mean your project is depending on VTK to get this setting.  Consider using FindTCL.cmake.\")\nENDIF(NOT TK_LIBRARY)\nMARK_AS_ADVANCED(TCL_LIBRARY TK_LIBRARY)\n")

160 161 162
#-----------------------------------------------------------------------------
# Configure VTKConfig.cmake for the build tree.
CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfig.cmake.in
163
               ${VTK_BINARY_DIR}/VTKConfig.cmake @ONLY IMMEDIATE)
164 165
CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfigVersion.cmake.in
               ${VTK_BINARY_DIR}/VTKConfigVersion.cmake @ONLY IMMEDIATE)
166 167 168 169 170

#-----------------------------------------------------------------------------
# Settings specific to the install tree.

# The "use" file.
171
SET(VTK_USE_FILE ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/UseVTK.cmake)
172

Brad King's avatar
Brad King committed
173
# The build settings file.
174
SET(VTK_BUILD_SETTINGS_FILE ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/VTKBuildSettings.cmake)
Brad King's avatar
Brad King committed
175

176
# The directory containing class list files for each kit.
177
SET(VTK_KITS_DIR_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR})
178

179 180 181
# The wrapping hints file.
IF(VTK_WRAP_HINTS)
  GET_FILENAME_COMPONENT(VTK_HINTS_FNAME ${VTK_WRAP_HINTS} NAME)
182
  SET(VTK_WRAP_HINTS_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/${VTK_HINTS_FNAME})
183 184
ENDIF(VTK_WRAP_HINTS)

185
# Include directories.
Brad King's avatar
Brad King committed
186
SET(VTK_INCLUDE_DIRS_CONFIG
187
  ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR}
Brad King's avatar
Brad King committed
188 189
  ${VTK_INCLUDE_DIRS_SYSTEM}
)
190 191

# Link directories.
192 193 194 195 196 197
IF(CYGWIN AND BUILD_SHARED_LIBS)
  # In Cygwin programs directly link to the .dll files.
  SET(VTK_LIBRARY_DIRS_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR})
ELSE(CYGWIN AND BUILD_SHARED_LIBS)
  SET(VTK_LIBRARY_DIRS_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_LIB_DIR})
ENDIF(CYGWIN AND BUILD_SHARED_LIBS)
198

199
# Executable and runtime library directories.
200
IF(WIN32)
201
  SET(VTK_EXECUTABLE_DIRS_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR})
202
  SET(VTK_RUNTIME_LIBRARY_DIRS_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR})
203
ELSE(WIN32)
204
  SET(VTK_EXECUTABLE_DIRS_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR})
205
  SET(VTK_RUNTIME_LIBRARY_DIRS_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_LIB_DIR})
206 207
ENDIF(WIN32)

208 209 210 211
IF(WIN32)
  SET(VTK_EXE_EXT ".exe")
ENDIF(WIN32)

212
# Executable locations.
213
SET(VTK_TCL_HOME_CONFIG "")
214
SET(VTK_PYTHONPATH_DIRS "")
215
SET(VTK_JAVA_JAR_CONFIG "")
216 217 218
SET(VTK_PARSE_JAVA_EXE_CONFIG "")
SET(VTK_WRAP_JAVA_EXE_CONFIG "")
SET(VTK_WRAP_PYTHON_EXE_CONFIG "")
219
SET(VTK_WRAP_PYTHON_INIT_EXE_CONFIG "")
220
SET(VTK_WRAP_TCL_EXE_CONFIG "")
221
SET(VTK_WRAP_TCL_INIT_EXE_CONFIG "")
222
SET(VTK_DOXYGEN_HOME_CONFIG "")
223
IF(VTK_WRAP_TCL)
224 225
  SET(VTK_WRAP_TCL_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapTcl${VTK_EXE_EXT})
  SET(VTK_WRAP_TCL_INIT_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapTclInit${VTK_EXE_EXT})
226
  SET(VTK_TCL_HOME_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_TCL_DIR})
227 228
ENDIF(VTK_WRAP_TCL)
IF(VTK_WRAP_PYTHON)
229
  IF(VTK_PYTHON_MODULE_PLATFORM_INSTALL_DIR EQUAL "${VTK_PYTHON_MODULE_INSTALL_DIR}")
230
    SET(VTK_PYTHONPATH_DIRS_CONFIG ${VTK_PYTHON_MODULE_INSTALL_DIR})
231
  ELSE(VTK_PYTHON_MODULE_PLATFORM_INSTALL_DIR EQUAL "${VTK_PYTHON_MODULE_INSTALL_DIR}")
232
    SET(VTK_PYTHONPATH_DIRS_CONFIG ${VTK_PYTHON_MODULE_INSTALL_DIR} ${VTK_PYTHON_MODULE_PLATFORM_INSTALL_DIR})
233
  ENDIF(VTK_PYTHON_MODULE_PLATFORM_INSTALL_DIR EQUAL "${VTK_PYTHON_MODULE_INSTALL_DIR}")
234
  STRING(REGEX REPLACE "{CMAKE_INSTALL_PREFIX}"
235 236
    "{VTK_INSTALL_PREFIX}" VTK_PYTHONPATH_DIRS_CONFIG
    "${VTK_PYTHONPATH_DIRS_CONFIG}")
237 238
  SET(VTK_WRAP_PYTHON_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapPython${VTK_EXE_EXT})
  SET(VTK_WRAP_PYTHON_INIT_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapPythonInit${VTK_EXE_EXT})
239 240
ENDIF(VTK_WRAP_PYTHON)
IF(VTK_WRAP_JAVA)
241 242
  SET(VTK_PARSE_JAVA_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkParseJava${VTK_EXE_EXT})
  SET(VTK_WRAP_JAVA_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapJava${VTK_EXE_EXT})
243
  SET(VTK_JAVA_JAR_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_JAVA_DIR}/vtk.jar)
244
ENDIF(VTK_WRAP_JAVA)
Sebastien Barre's avatar
Sebastien Barre committed
245
SET(VTK_ENCODESTRING_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkEncodeString${VTK_EXE_EXT})
246 247

# VTK style script locations.
248 249 250 251 252
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)
253 254

IF(VTK_USE_PARALLEL)
255
  SET(VTK_PRT_IMAGE_TEST_TCL_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/testing/prtImageTest.tcl)
256
ELSE(VTK_USE_PARALLEL)
257
  SET(VTK_PRT_IMAGE_TEST_TCL_CONFIG "")
258
ENDIF(VTK_USE_PARALLEL)
259

260
# Location of tk internal headers and resources provided by VTK.
261
SET(VTK_TK_INTERNAL_DIR_CONFIG "")
262
IF(TK_INTERNAL_PATH)
Sebastien Barre's avatar
ENH:  
Sebastien Barre committed
263 264 265 266 267
  VTK_GET_TCL_TK_VERSION ("TCL_TK_MAJOR_VERSION" "TCL_TK_MINOR_VERSION")
  SET (TCL_TK_VERSION "${TCL_TK_MAJOR_VERSION}.${TCL_TK_MINOR_VERSION}")
  IF("${TK_INTERNAL_PATH}" MATCHES 
     "Utilities/TclTk/internals/tk${TCL_TK_VERSION}")
    SET(VTK_TK_INTERNAL_DIR_CONFIG 
268
        ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR}/TclTk/internals/tk${TCL_TK_VERSION})
Sebastien Barre's avatar
ENH:  
Sebastien Barre committed
269 270
  ENDIF("${TK_INTERNAL_PATH}" MATCHES 
        "Utilities/TclTk/internals/tk${TCL_TK_VERSION}")
271
ENDIF(TK_INTERNAL_PATH)
272

273
SET(VTK_TK_INTERNAL_ROOT_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR})
274

275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302
# The resources dir is only worth exporting if we are building with
# Tcl/Tk static
SET(VTK_TK_RESOURCES_DIR_CONFIG "")
IF(VTK_USE_TK AND VTK_TCL_TK_STATIC)
  IF(VTK_TK_RESOURCES_DIR)
    VTK_GET_TCL_TK_VERSION ("TCL_TK_MAJOR_VERSION" "TCL_TK_MINOR_VERSION")
    SET (TCL_TK_VERSION "${TCL_TK_MAJOR_VERSION}.${TCL_TK_MINOR_VERSION}")
    IF("${VTK_TK_RESOURCES_DIR}" MATCHES 
        "Utilities/TclTk/resources/tk${TCL_TK_VERSION}")
      SET(VTK_TK_RESOURCES_DIR_CONFIG 
        ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_INCLUDE_DIR}/TclTk/resources/tk${TCL_TK_VERSION}/win/rc)
    ENDIF("${VTK_TK_RESOURCES_DIR}" MATCHES 
      "Utilities/TclTk/resources/tk${TCL_TK_VERSION}")
  ENDIF(VTK_TK_RESOURCES_DIR)
ENDIF(VTK_USE_TK AND VTK_TCL_TK_STATIC)

IF(VTK_TCL_TK_COPY_SUPPORT_LIBRARY)
  VTK_GET_TCL_TK_VERSION ("TCL_TK_MAJOR_VERSION" "TCL_TK_MINOR_VERSION")
  SET (TCL_TK_VERSION "${TCL_TK_MAJOR_VERSION}.${TCL_TK_MINOR_VERSION}")
  SET(VTK_TCL_SUPPORT_LIBRARY_PATH_CONFIG 
    ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_TCL_DIR}/tcl${TCL_TK_VERSION})
  SET(VTK_TK_SUPPORT_LIBRARY_PATH_CONFIG 
    ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_TCL_DIR}/tk${TCL_TK_VERSION})
ELSE(VTK_TCL_TK_COPY_SUPPORT_LIBRARY)
  SET(VTK_TCL_SUPPORT_LIBRARY_PATH_CONFIG ${VTK_TCL_SUPPORT_LIBRARY_PATH})
  SET(VTK_TK_SUPPORT_LIBRARY_PATH_CONFIG ${VTK_TK_SUPPORT_LIBRARY_PATH})
ENDIF(VTK_TCL_TK_COPY_SUPPORT_LIBRARY)

303
# CMake extension module directory and macro file.
Ken Martin's avatar
Ken Martin committed
304
SET(VTK_CMAKE_DIR_CONFIG
305
    "${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/CMake")
306
SET(VTK_TCL_TK_MACROS_MODULE_CONFIG
307 308
    "${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)
309

310
# Library dependencies file.
311
SET(VTK_LIBRARY_DEPENDS_FILE "${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_PACKAGE_DIR}/VTKLibraryDepends.cmake")
312

Andy Cedilnik's avatar
Andy Cedilnik committed
313 314 315
# No backward compatibility hack needed for installed path
SET(VTK_CONFIG_BACKWARD_COMPATIBILITY_HACK)

316
#-----------------------------------------------------------------------------
317
# Configure VTKConfig.cmake for the install tree.
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333

# 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.
334
SET(VTK_CONFIGURATION_TYPES_CONFIG)
335

336 337 338 339 340 341 342 343 344 345 346 347 348 349
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.
  IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
350 351 352 353 354
    INSTALL(FILES
      ${VTK_BINARY_DIR}/Utilities/${DOLLAR}{BUILD_TYPE}/VTKConfig.cmake
      DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24}
      COMPONENT Development
      )
355 356 357 358 359 360 361 362 363
  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)
364 365 366 367 368
    INSTALL(FILES
      ${VTK_BINARY_DIR}/Utilities/VTKConfig.cmake
      DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24}
      COMPONENT Development
      )
369 370
  ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
ENDIF(CMAKE_CONFIGURATION_TYPES)
371 372 373 374 375 376 377 378 379

# Create and install the package version file.
CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfigVersion.cmake.in
               ${VTK_BINARY_DIR}/Utilities/VTKConfigVersion.cmake
               @ONLY IMMEDIATE)
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
  INSTALL(FILES ${VTK_BINARY_DIR}/Utilities/VTKConfigVersion.cmake
    DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24} COMPONENT Development)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)