From: Daniel Arndt Date: Tue, 30 May 2023 18:07:32 +0000 (-0400) Subject: Extend strip_known_generator_expressions X-Git-Tag: v9.5.0-rc1~137^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50519b5cb781e88af11dce40f703197004f418e5;p=dealii.git Extend strip_known_generator_expressions --- diff --git a/cmake/macros/macro_copy_target_properties.cmake b/cmake/macros/macro_copy_target_properties.cmake index 6533dfeef1..1d6ed9fbb0 100644 --- a/cmake/macros/macro_copy_target_properties.cmake +++ b/cmake/macros/macro_copy_target_properties.cmake @@ -104,16 +104,19 @@ function(copy_target_properties _destination_target) get_target_property(_values ${_entry} INTERFACE_COMPILE_DEFINITIONS) if(NOT "${_values}" MATCHES "-NOTFOUND") + strip_known_generator_expressions(_values) list(APPEND _compile_definitions ${_values}) endif() get_target_property(_values ${_entry} INTERFACE_COMPILE_OPTIONS) if(NOT "${_values}" MATCHES "-NOTFOUND") + strip_known_generator_expressions(_values) list(APPEND _compile_options ${_values}) endif() get_target_property(_values ${_entry} INTERFACE_LINK_OPTIONS) if(NOT "${_values}" MATCHES "-NOTFOUND") + strip_known_generator_expressions(_values) list(APPEND _link_options ${_values}) endif() endwhile() diff --git a/cmake/macros/macro_strip_known_generator_expressions.cmake b/cmake/macros/macro_strip_known_generator_expressions.cmake index 25ccef8d5f..31ab538c97 100644 --- a/cmake/macros/macro_strip_known_generator_expressions.cmake +++ b/cmake/macros/macro_strip_known_generator_expressions.cmake @@ -21,6 +21,14 @@ # macro(strip_known_generator_expressions _variable) - string(REGEX REPLACE "^\\$$" "\\1" ${_variable} "${${_variable}}") + set(generator_expressions + "^\\$$" + "^\\$<\\$:(.*)>$" + "^\\$<\\$:(.*)>$" + ) + + foreach(expression ${generator_expressions}) + string(REGEX REPLACE ${expression} "\\1" ${_variable} "${${_variable}}") + endforeach() endmacro()