Commit 2ed983af authored by Chris Harris's avatar Chris Harris
Browse files

Replace VTKConfig.cmake guard variable with VTK target

Rather than using a variable set in VTKConfig.cmake use a VTK target
vtkCommonCore to prevent multiple loads of the VTK targets. This is
needed in the case of ParaView that also defines VTK targets in its
config file.

Change-Id: Idfc9a9087475a4d1d074647e58454cc693f3f6e2
parent 481e89db
......@@ -30,8 +30,7 @@ set(VTK_MODULES_ENABLED "@VTK_CONFIG_MODULES_ENABLED@")
# Import VTK targets.
set(VTK_CONFIG_TARGETS_FILE "@VTK_CONFIG_TARGETS_FILE@")
if(NOT VTK_TARGETS_IMPORTED@VTK_CONFIG_TARGETS_CONDITION@)
set(VTK_TARGETS_IMPORTED 1)
if(NOT TARGET @VTK_COMMON_TARGET@)
include("${VTK_CONFIG_TARGETS_FILE}")
endif()
......
......@@ -223,6 +223,8 @@ set(VTK_CONFIG_CMAKE_DIR "${VTK_SOURCE_DIR}/CMake")
set(VTK_CONFIG_TARGETS_CONDITION " AND NOT VTK_BINARY_DIR")
set(VTK_CONFIG_TARGETS_FILE "${VTK_BINARY_DIR}/VTKTargets.cmake")
set(VTK_CONFIG_MODULE_API_FILE "${VTK_SOURCE_DIR}/CMake/vtkModuleAPI.cmake")
# Target used to ensure VTKConfig is load just once
set(VTK_COMMON_TARGET vtkCommonCore)
configure_file(CMake/VTKConfig.cmake.in VTKConfig.cmake @ONLY)
# Generate VTKConfig.cmake for the install tree.
......
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