From: Matthias Maier Date: Wed, 15 Feb 2023 17:35:46 +0000 (-0600) Subject: CMake: make older CMake versions happy X-Git-Tag: v9.5.0-rc1~446^2~18 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe2dc50d96aa21f78c775551b762ad203dab33e4;p=dealii.git CMake: make older CMake versions happy --- diff --git a/cmake/macros/macro_print_target_properties.cmake b/cmake/macros/macro_print_target_properties.cmake index 434f6b9b49..d6f9b9b5ff 100644 --- a/cmake/macros/macro_print_target_properties.cmake +++ b/cmake/macros/macro_print_target_properties.cmake @@ -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}")