From add7c68d511e04e659cddf677b0b25042c56b012 Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Thu, 27 Oct 2022 06:44:50 -0600 Subject: [PATCH] Add make dependencies to rebuild CMake when vtkm.module files change Also improved a diagnostic when bad identifiers are used in vtkm.module files. --- CMake/VTKmModules.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMake/VTKmModules.cmake b/CMake/VTKmModules.cmake index 4117b45e0..a9c4e406c 100644 --- a/CMake/VTKmModules.cmake +++ b/CMake/VTKmModules.cmake @@ -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()