Skip to content

Commit ea7cdc4

Browse files
thewtexjcfr
authored andcommitted
Reset VTK_MODULES_REQUESTED to all modules with multiple calls.
This generates more expected behaviour when find_package(VTK COMPONENTS X Y Z) followed by find_package(VTK) is called. When no components are specified in subsequent calls, reset VTK_MODULES_REQUESTED to all modules enabled. Change-Id: I9264ed61614a7c221e7fcc354bd67afd437e258e
1 parent b55dad7 commit ea7cdc4

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

CMake/VTKConfig.cmake.in

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,7 @@ include("@VTK_CONFIG_MODULE_API_FILE@")
5353
if(VTK_FIND_COMPONENTS)
5454
# Specific modules requested by find_package(VTK).
5555
set(VTK_MODULES_REQUESTED "${VTK_FIND_COMPONENTS}")
56-
elseif(NOT "${CMAKE_VERSION}" VERSION_GREATER 2.8.4.20110407)
57-
# CMake 2.8.4 and lower do not forward the components list through
58-
# their FindVTK.cmake module, so unless the application called
59-
#
60-
# find_package(VTK NO_MODULE ...)
61-
#
62-
# then only the per-component variables VTK_FIND_REQUIRED_<mod> will
63-
# have leaked through.
64-
set(VTK_MODULES_REQUESTED "")
65-
get_cmake_property(_vars VARIABLES)
66-
foreach(v IN LISTS _vars)
67-
if("x${v}" MATCHES "^xVTK_FIND_REQUIRED_" AND ${v})
68-
string(REGEX REPLACE "^VTK_FIND_REQUIRED_" "" _mod "${v}")
69-
list(APPEND VTK_MODULES_REQUESTED ${_mod})
70-
endif()
71-
endforeach()
72-
endif()
73-
if(NOT VTK_MODULES_REQUESTED)
56+
else()
7457
# No specific modules requested. Use all of them.
7558
set(VTK_MODULES_REQUESTED "${VTK_MODULES_ENABLED}")
7659
endif()

0 commit comments

Comments
 (0)