From: Matthias Maier Date: Mon, 19 Feb 2024 19:46:15 +0000 (-0600) Subject: CMake: bugfix: honor debug,optimized,release keywords in LIBRARIES and TARGETS X-Git-Tag: relicensing~15^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6e1e0cd6f7dead9406ca7846f22d6c50f984b01;p=dealii.git CMake: bugfix: honor debug,optimized,release keywords in LIBRARIES and TARGETS --- diff --git a/cmake/macros/macro_process_feature.cmake b/cmake/macros/macro_process_feature.cmake index a56a361ed3..de53634a25 100644 --- a/cmake/macros/macro_process_feature.cmake +++ b/cmake/macros/macro_process_feature.cmake @@ -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: #