]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: use new macros also in deal_ii_setup_target()
authorMatthias Maier <tamiko@43-1.org>
Thu, 30 Mar 2023 16:24:24 +0000 (11:24 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 30 Mar 2023 17:59:04 +0000 (12:59 -0500)
cmake/config/CMakeLists.txt
cmake/macros/macro_deal_ii_setup_target.cmake

index 5642088e9113a6c7796f4f134f04c1eb5c0dac20..7482f6f8c13277b8c3faa281a04fccc9c3af7707 100644 (file)
@@ -49,6 +49,8 @@ set(_macros
   ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_query_git_information.cmake
   ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_setup_target.cmake
   ${CMAKE_SOURCE_DIR}/cmake/macros/macro_shell_escape_option_groups.cmake
+  ${CMAKE_SOURCE_DIR}/cmake/macros/macro_target_compile_flags.cmake
+  ${CMAKE_SOURCE_DIR}/cmake/macros/macro_target_link_flags.cmake
   )
 file(COPY ${_macros}
   DESTINATION ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/macros
index 7efd8083d74ac8dd20b24f0b8af900be033c65ae..2070cad6eb3937f5d49de003e58dd78d1a1c8134 100644 (file)
@@ -90,21 +90,15 @@ macro(deal_ii_setup_target _target)
     set(_build "RELEASE")
   endif()
 
-  separate_arguments(_compile_options UNIX_COMMAND
+  target_compile_flags(${_target} PRIVATE "$<COMPILE_LANGUAGE:CXX>"
     "${DEAL_II_WARNING_FLAGS} ${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}"
     )
-  shell_escape_option_groups(_compile_options)
-  target_compile_options(${_target} PRIVATE
-    $<$<COMPILE_LANGUAGE:CXX>:${_compile_options}>
-    )
 
   get_property(_type TARGET ${_target} PROPERTY TYPE)
   if(NOT "${_type}" STREQUAL "OBJECT_LIBRARY")
-    separate_arguments(_link_options UNIX_COMMAND
+    target_link_flags(${_target} PRIVATE
       "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}"
       )
-    shell_escape_option_groups(_link_options)
-    target_link_options(${_target} PRIVATE ${_link_options})
   endif()
 
   target_link_libraries(${_target} ${DEAL_II_TARGET_${_build}})

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.