]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: process_feature() disallow general/optimized/debug identifiers
authorMatthias Maier <tamiko@43-1.org>
Fri, 3 Mar 2023 20:09:57 +0000 (14:09 -0600)
committerMatthias Maier <tamiko@43-1.org>
Fri, 17 Mar 2023 12:44:53 +0000 (07:44 -0500)
cmake/macros/macro_process_feature.cmake

index a80d8778da700603272126ae8fb0e8fd2f25fc22..f986d14164d1a2f4fb62ab9be118910394838f1b 100644 (file)
@@ -122,24 +122,24 @@ macro(process_feature _feature)
     elseif("${_arg}" STREQUAL "OPTIONAL")
       set(_required FALSE)
 
-    elseif(_arg MATCHES "^(optimized|debug|general)$"
-            AND "${_current_suffix}" STREQUAL "LIBRARIES")
-      list(APPEND _temp_${_current_suffix} ${_arg})
-
     else()
       if ("${_current_suffix}" STREQUAL "")
         message(FATAL_ERROR
           "Internal configuration error: the second "
           "argument to process_feature must be a keyword"
           )
+      elseif(_arg MATCHES "^(optimized|debug|general)$")
+        message(FATAL_ERROR
+          "Internal configuration error: process_feature() does not support "
+          "»debug«, »optimized«, or »general« library identifiers, use the "
+          "appropriate keyword instead."
+          )
       endif()
 
       mark_as_advanced(${_arg})
 
       if("${_current_suffix}" STREQUAL "CLEAR")
-        if(NOT _arg MATCHES "^(optimized|debug|general)$")
-          list(APPEND _clear_variables_list ${_arg})
-        endif()
+        list(APPEND _clear_variables_list ${_arg})
 
       else()
 

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.