]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Bugfix, also propagate cxx flags to insource targets
authorMatthias Maier <tamiko@43-1.org>
Thu, 2 Mar 2023 13:31:22 +0000 (07:31 -0600)
committerMatthias Maier <tamiko@43-1.org>
Fri, 17 Mar 2023 12:44:53 +0000 (07:44 -0500)
cmake/macros/macro_insource_setup_target.cmake

index 09faaddc7c21afba88460f1125b12d21b224bca2..c76f55dc2484e5740ad81c1cec125ba19a08a4c4 100644 (file)
@@ -31,6 +31,13 @@ function(insource_setup_target _target _build)
     RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
     )
 
+  separate_arguments(_compile_options UNIX_COMMAND
+    "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}"
+    )
+  target_compile_options(${_target} PRIVATE
+    $<$<COMPILE_LANGUAGE:CXX>:${_compile_options}>
+    )
+
   target_include_directories(${_target}
     PRIVATE
       "${CMAKE_BINARY_DIR}/include"

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.