Merge topic 'rebuild-modules'

add7c68d5 Add make dependencies to rebuild CMake when vtkm.module files change

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2902
This commit is contained in:
Kenneth Moreland 2022-10-31 15:56:27 +00:00 committed by Kitware Robot
commit 89aaecff32

@ -232,7 +232,8 @@ function(_vtkm_module_parse_module_file module_file name_var)
# Check required arguments
if(_vtkm_module_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Module file ${module_file} contains unknown options.")
message(FATAL_ERROR
"Module file ${module_file} contains unknown options: ${_vtkm_module_UNPARSED_ARGUMENTS}")
endif()
if(NOT _vtkm_module_NAME)
message(FATAL_ERROR "Module file ${module_file} does not specify a NAME option.")
@ -246,6 +247,10 @@ function(_vtkm_module_parse_module_file module_file name_var)
get_filename_component(directory "${module_file}" DIRECTORY)
vtkm_module_set_property(${NAME} DIRECTORY "${directory}")
# Add a build dependency that reruns CMake whenever the vtkm.module file changes.
set_property(DIRECTORY "${PROJECT_SOURCE_DIR}"
APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${module_file}")
set(${name_var} ${NAME} PARENT_SCOPE)
endfunction()