]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: add another prominent warning
authorMatthias Maier <tamiko@43-1.org>
Tue, 23 May 2023 11:44:17 +0000 (06:44 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 23 May 2023 21:20:32 +0000 (16:20 -0500)
cmake/macros/macro_define_interface_target.cmake

index afa17aabc3f1be80c6a205645ef0cc5160f2f008..a3dff00f31e0574efba9d241c229ad2c291531a3 100644 (file)
@@ -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()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.