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

Also improved a diagnostic when bad identifiers are used in vtkm.module
files.
This commit is contained in:
Kenneth Moreland 2022-10-27 06:44:50 -06:00
parent f8e5342e14
commit add7c68d51

@ -219,7 +219,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.")
@ -233,6 +234,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()