]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Extend strip_known_generator_expressions
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 30 May 2023 18:07:32 +0000 (14:07 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Wed, 31 May 2023 12:57:23 +0000 (08:57 -0400)
cmake/macros/macro_copy_target_properties.cmake
cmake/macros/macro_strip_known_generator_expressions.cmake

index 6533dfeef16f72fccfaf2e5131341ea6af48ef8a..1d6ed9fbb0d4e5b69aa0651fe352d60181897253 100644 (file)
@@ -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()
index 25ccef8d5ff158c8593d185a8138032807c5fed1..31ab538c97cd81101fadc9f65bdf909d0a68d0cd 100644 (file)
 #
 
 macro(strip_known_generator_expressions _variable)
-  string(REGEX REPLACE "^\\$<LINK_ONLY:(.*)>$" "\\1" ${_variable} "${${_variable}}")
+  set(generator_expressions
+    "^\\$<LINK_ONLY:(.*)>$"
+    "^\\$<\\$<LINK_LANGUAGE:CXX>:(.*)>$"
+    "^\\$<\\$<COMPILE_LANGUAGE:CXX>:(.*)>$"
+    )
+
+  foreach(expression ${generator_expressions})
+    string(REGEX REPLACE ${expression} "\\1" ${_variable} "${${_variable}}")
+  endforeach()
 endmacro()
 

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.