]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Use DEAL_II_FEATURES in setup_write_config.cmake
authorMatthias Maier <tamiko@43-1.org>
Sat, 5 Mar 2016 08:27:46 +0000 (02:27 -0600)
committerMatthias Maier <tamiko@43-1.org>
Fri, 18 Mar 2016 21:59:19 +0000 (16:59 -0500)
This is a first step to avoid the variables introspection done in this
setup file.

cmake/setup_write_config.cmake

index c458b72f3566eb47e0c8eaa060492b0f8d5ac7a6..638f81eab39374a0f6bb67273dd1a341b584698c 100644 (file)
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2014 - 2015 by the deal.II authors
+## Copyright (C) 2014 - 2016 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -164,22 +164,15 @@ ENDIF()
 _both("DEAL_II_ALLOW_AUTODETECTION = ${DEAL_II_ALLOW_AUTODETECTION}):\n")
 
 
-GET_CMAKE_PROPERTY(_variables VARIABLES)
-FOREACH(_var ${_variables})
-  IF(_var MATCHES "DEAL_II_WITH")
-    LIST(APPEND _features "${_var}")
-  ELSEIF(_var MATCHES "DEAL_II_COMPONENT")
-    LIST(APPEND _components "${_var}")
-  ENDIF()
-ENDFOREACH()
+SET(_deal_ii_features_sorted ${DEAL_II_FEATURES})
+LIST(SORT _deal_ii_features_sorted)
+FOREACH(_feature ${_deal_ii_features_sorted})
+  SET(_var DEAL_II_WITH_${_feature})
 
-FOREACH(_var ${_features})
   IF(${${_var}})
-
     #
     # The feature is enabled:
     #
-    STRING(REGEX REPLACE "^DEAL_II_WITH_" "" _feature ${_var})
     IF(FEATURE_${_feature}_EXTERNAL_CONFIGURED)
       _both("#        ${_var} set up with external dependencies\n")
     ELSEIF(FEATURE_${_feature}_BUNDLED_CONFIGURED)
@@ -236,6 +229,13 @@ ENDFOREACH()
 _both(
   "#\n#  Component configuration:\n"
   )
+
+GET_CMAKE_PROPERTY(_variables VARIABLES)
+FOREACH(_var ${_variables})
+  IF(_var MATCHES "DEAL_II_COMPONENT")
+    LIST(APPEND _components "${_var}")
+  ENDIF()
+ENDFOREACH()
 FOREACH(_var ${_components})
   IF(_var MATCHES "DEAL_II_COMPONENT")
     IF(${${_var}})

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.