]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: use new macro when setting up dealii::dealii target
authorMatthias Maier <tamiko@43-1.org>
Thu, 30 Mar 2023 17:43:51 +0000 (12:43 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 30 Mar 2023 17:59:04 +0000 (12:59 -0500)
source/CMakeLists.txt

index e64c3715499dc2c2b766db3d035adede5b54ad2d..ae4930bd03d5de5e94685a3fb03b1ca681c86273 100644 (file)
@@ -82,11 +82,10 @@ add_subdirectory(arborx)
 #
 
 add_library(${DEAL_II_TARGET_NAME} INTERFACE)
-separate_arguments(_compile_options UNIX_COMMAND "${DEAL_II_CXX_FLAGS}")
-shell_escape_option_groups(_compile_options)
-target_compile_options(${DEAL_II_TARGET_NAME} INTERFACE
-  $<$<COMPILE_LANGUAGE:CXX>:${_compile_options}>
+target_compile_flags(${DEAL_II_TARGET_NAME} INTERFACE
+  "$<COMPILE_LANGUAGE:CXX>" "${DEAL_II_CXX_FLAGS}"
   )
+target_link_flags(${DEAL_II_TARGET_NAME} INTERFACE "${DEAL_II_LINKER_FLAGS}")
 
 foreach(build ${DEAL_II_BUILD_TYPES})
   string(TOLOWER ${build} build_lowercase)
@@ -145,12 +144,12 @@ foreach(build ${DEAL_II_BUILD_TYPES})
     RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}"
     )
 
-  separate_arguments(_compile_options UNIX_COMMAND
+  target_compile_flags(${DEAL_II_TARGET_NAME} INTERFACE
+    "$<AND:$<CONFIG:${build_camelcase}>,$<COMPILE_LANGUAGE:CXX>>"
     "${DEAL_II_CXX_FLAGS_${build}}"
     )
-  shell_escape_option_groups(_compile_options)
-  target_compile_options(${DEAL_II_TARGET_NAME} INTERFACE
-    "$<$<CONFIG:${build_camelcase}>:$<$<COMPILE_LANGUAGE:CXX>:${_compile_options}>>"
+  target_link_flags(${DEAL_II_TARGET_NAME} INTERFACE
+    "$<CONFIG:${build_camelcase}>" "${DEAL_II_LINKER_FLAGS_${build}}"
     )
 
   if(CMAKE_SYSTEM_NAME MATCHES "Darwin")

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.