]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: bugfix: honor debug,optimized,release keywords in LIBRARIES and TARGETS
authorMatthias Maier <tamiko@43-1.org>
Mon, 19 Feb 2024 19:46:15 +0000 (13:46 -0600)
committerMatthias Maier <tamiko@43-1.org>
Mon, 19 Feb 2024 19:46:15 +0000 (13:46 -0600)
cmake/macros/macro_process_feature.cmake

index a56a361ed327efdfc464780e80b0681fe4e8afcc..de53634a258ccdb69111b0aa9dc27f03bc03391a 100644 (file)
@@ -166,6 +166,31 @@ macro(process_feature _feature)
   set(${_feature}_CLEAR_VARIABLES ${_clear} CACHE INTERNAL "")
 
   if(${_feature}_FOUND)
+    #
+    # Take care of "optimized", "debug", and "general" keywords in
+    # LIBRARIES and TARGETS variables by distributing affected entries into
+    # the respective LIBRARIES_(DEBUG|RELEASE) and TARGETS_(DEBUG|RELEASE)
+    # variables.
+    #
+    foreach(_suffix LIBRARIES TARGETS)
+      set(_temp ${_temp_${_suffix}})
+      set(_temp_${_suffix} "")
+      set(_switch "")
+      foreach(_entry ${_temp})
+        if("${_entry}" STREQUAL "optimized")
+          set(_split_configuration TRUE)
+          set(_switch "_RELEASE")
+        elseif("${_entry}" STREQUAL "debug")
+          set(_split_configuration TRUE)
+          set(_switch "_DEBUG")
+        elseif("${_entry}" STREQUAL "general")
+          set(_switch "")
+        else()
+          list(APPEND _temp_${_suffix}${_switch} ${_entry})
+        endif()
+      endforeach()
+    endforeach()
+
     #
     # Deduplicate and stringify entries:
     #

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.