From: Matthias Maier Date: Tue, 23 May 2023 21:18:36 +0000 (-0500) Subject: CMake: change a warning into an error X-Git-Tag: v9.5.0-rc1~200^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15252%2Fhead;p=dealii.git CMake: change a warning into an error For the time being we are not prepared to encounter an undefined target at this point of the configure process. Thus simply emit a fatal error instead of a warning. --- diff --git a/cmake/macros/macro_copy_target_properties.cmake b/cmake/macros/macro_copy_target_properties.cmake index c9b62b21b2..6533dfeef1 100644 --- a/cmake/macros/macro_copy_target_properties.cmake +++ b/cmake/macros/macro_copy_target_properties.cmake @@ -79,11 +79,13 @@ function(copy_target_properties _destination_target) if(TARGET ${_lib}) list(APPEND _source_targets ${_lib}) else() - # Warn loudly if we encounter an undefined target: + # + # Complain loudly if we encounter an undefined target: + # if("${_lib}" MATCHES "::") - message(WARNING + message(FATAL_ERROR "Undefined imported target name »${_lib}« present in interface " - "of target »${_entry}«" + "of target »${_entry}«." ) endif() list(APPEND _libraries ${_lib}) diff --git a/cmake/macros/macro_define_interface_target.cmake b/cmake/macros/macro_define_interface_target.cmake index a3dff00f31..0bc0591dbf 100644 --- a/cmake/macros/macro_define_interface_target.cmake +++ b/cmake/macros/macro_define_interface_target.cmake @@ -93,9 +93,11 @@ function(define_interface_target _feature) ) if(NOT "${_libraries}" STREQUAL "") foreach(_lib ${_libraries}) - # Warn loudly if we encounter an undefined target: + # + # Complain loudly if we encounter an undefined target: + # if("${_lib}" MATCHES "::") - message(WARNING + message(FATAL_ERROR "Undefined imported target name »${_lib}« present when defining " "interface target »${_interface_target}«" )