]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: make older CMake versions happy
authorMatthias Maier <tamiko@43-1.org>
Wed, 15 Feb 2023 17:35:46 +0000 (11:35 -0600)
committerMatthias Maier <tamiko@43-1.org>
Fri, 17 Mar 2023 12:44:53 +0000 (07:44 -0500)
cmake/macros/macro_print_target_properties.cmake

index 434f6b9b491549c2ca2e23550c6998655c47622d..d6f9b9b5ff12d4339da4a0b4acda472db233cf68 100644 (file)
@@ -28,13 +28,20 @@ function(print_target_properties _target)
   set(_messages)
   list(APPEND _messages "Target: ${_target}")
 
-  foreach(_property
+  set(_properties
+    INTERFACE_LINK_LIBRARIES INTERFACE_INCLUDE_DIRECTORIES
+    INTERFACE_SYSTEM_INCLUDE_DIRECTORIES INTERFACE_COMPILE_DEFINITIONS
+    INTERFACE_COMPILE_OPTIONS INTERFACE_LINK_OPTIONS
+    )
+  if(NOT CMAKE_VERSION VERSION_LESS 3.19)
+    set(_properties
       TYPE VERSION SOVERSION LINK_LIBRARIES INCLUDE_DIRECTORIES
       COMPILE_DEFINITIONS COMPILE_FEATURES COMPILE_OPTIONS LINK_OPTIONS
-      INTERFACE_LINK_LIBRARIES INTERFACE_INCLUDE_DIRECTORIES
-      INTERFACE_SYSTEM_INCLUDE_DIRECTORIES INTERFACE_COMPILE_DEFINITIONS
-      INTERFACE_COMPILE_OPTIONS INTERFACE_LINK_OPTIONS
+      ${_properties}
       )
+  endif()
+
+  foreach(_property ${_properties})
     get_target_property(_value ${_target} ${_property})
     if(NOT "${_value}" MATCHES "-NOTFOUND" AND NOT "${_value}" STREQUAL "")
       string(REPLACE ";" " " _value "${_value}")

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.