From: Matthias Maier Date: Tue, 23 May 2023 11:44:17 +0000 (-0500) Subject: CMake: add another prominent warning X-Git-Tag: v9.5.0-rc1~200^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79b928e3de01c43fd2ff70c40aa3b3652f2f698c;p=dealii.git CMake: add another prominent warning --- diff --git a/cmake/macros/macro_define_interface_target.cmake b/cmake/macros/macro_define_interface_target.cmake index afa17aabc3..a3dff00f31 100644 --- a/cmake/macros/macro_define_interface_target.cmake +++ b/cmake/macros/macro_define_interface_target.cmake @@ -92,6 +92,16 @@ function(define_interface_target _feature) ${${_feature}_LIBRARIES} ${${_feature}_LIBRARIES_${_build}} ) if(NOT "${_libraries}" STREQUAL "") + foreach(_lib ${_libraries}) + # Warn loudly if we encounter an undefined target: + if("${_lib}" MATCHES "::") + message(WARNING + "Undefined imported target name »${_lib}« present when defining " + "interface target »${_interface_target}«" + ) + endif() + endforeach() + message(STATUS " LINK_LIBRARIES: ${_libraries}") target_link_libraries(${_interface_target} INTERFACE ${_libraries}) endif()