]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Use DEAL_II_FEATURES in config/CMakeLists.txt 2368/head
authorMatthias Maier <tamiko@43-1.org>
Sat, 5 Mar 2016 08:51:21 +0000 (02:51 -0600)
committerMatthias Maier <tamiko@43-1.org>
Fri, 18 Mar 2016 22:03:05 +0000 (17:03 -0500)
This commit also rearranges the logic such that variables belonging to a
certain features are grouped together again.

cmake/config/CMakeLists.txt

index 26e582ee8a8e9bc1a96d9465774b82cd84f6b2b5..d96cc86fab62bc7012050fb4d497dd4af1894739 100644 (file)
@@ -175,26 +175,31 @@ FOREACH(_file ${_files})
   FILE(APPEND ${_file} "\n\n#\n# Feature configuration:\n#\n\n")
 ENDFOREACH()
 
-GET_CMAKE_PROPERTY(res VARIABLES)
-FOREACH(var ${res})
-  #
-  # Workaround: We export all variables that match "DEAL_II_.*WITH" to also
-  # export package configuration variables of the form
-  #   DEAL_II_ARPACK_WITH_PARPACK
-  # etc.
-  #
-  IF(var MATCHES "DEAL_II_.*WITH")
-    STRING(REPLACE "DEAL_II_WITH_" "" _name ${var})
-
-    FOREACH(_file ${_files})
-      FILE(APPEND ${_file} "SET(${var} ${${var}})\n")
-      IF(${var} AND NOT "${${_name}_VERSION}" STREQUAL "")
-        FILE(APPEND ${_file}
-          "SET(DEAL_II_${_name}_VERSION \"${${_name}_VERSION}\")\n"
-          )
+GET_CMAKE_PROPERTY(_res VARIABLES)
+FOREACH(_var ${_res})
+  IF(_var MATCHES "DEAL_II_.*WITH")
+    LIST(APPEND _additional_config_variables ${_var})
+  ENDIF()
+ENDFOREACH()
+
+SET(_deal_ii_features_sorted ${DEAL_II_FEATURES})
+LIST(SORT _deal_ii_features_sorted)
+FOREACH(_name ${_deal_ii_features_sorted})
+  SET(_var DEAL_II_WITH_${_name})
+
+  FOREACH(_file ${_files})
+    FILE(APPEND ${_file} "SET(${_var} ${${_var}})\n")
+    IF(${_var} AND NOT "${${_name}_VERSION}" STREQUAL "")
+      FILE(APPEND ${_file}
+        "SET(DEAL_II_${_name}_VERSION \"${${_name}_VERSION}\")\n"
+        )
+    ENDIF()
+    FOREACH(_additional ${_additional_config_variables})
+      IF(_additional MATCHES "DEAL_II_${_name}_WITH")
+        FILE(APPEND ${_file} "SET(${_additional} ${${_additional}})\n")
       ENDIF()
     ENDFOREACH()
-  ENDIF()
+  ENDFOREACH()
 ENDFOREACH()
 
 MESSAGE(STATUS "Setting up project configuration - Done")

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.