Commit 1c7d9a87 authored by Brad King's avatar Brad King

Reject application requests for missing modules

When an application writes

  find_package(VTK ... vtkMissingModule)

vtk_module_config (invoked from VTKConfig.cmake) should reject the
missing module if it is not enabled.  The current vtk_module_load check
incorrectly accepts modules that have been previously enabled in a build
tree but are no longer available.  Test against VTK_MODULES_ENABLED.

Change-Id: If0769b6192bf9c5878b7ef1e581d04df18b6bbef
parent f087f3a6
......@@ -67,6 +67,18 @@ endmacro()
# <namespace>_LIBRARY_DIRS = Library search path (for outside dependencies)
# Do not name a module as the namespace.
macro(vtk_module_config ns)
set(_${ns}_MISSING ${ARGN})
if(_${ns}_MISSING)
list(REMOVE_ITEM _${ns}_MISSING ${VTK_MODULES_ENABLED})
endif()
if(_${ns}_MISSING)
set(msg "")
foreach(mod ${_${ns}_MISSING})
set(msg "${msg}\n ${mod}")
endforeach()
message(FATAL_ERROR "Requested modules not available:${msg}")
endif()
set(${ns}_DEFINITIONS "")
set(${ns}_LIBRARIES "")
set(${ns}_INCLUDE_DIRS "")
......
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