]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Use DEAL_II_COMPONENTS in setup_write_config.cmake
authorMatthias Maier <tamiko@43-1.org>
Sat, 5 Mar 2016 08:33:48 +0000 (02:33 -0600)
committerMatthias Maier <tamiko@43-1.org>
Fri, 18 Mar 2016 21:59:19 +0000 (16:59 -0500)
... and get rid of a variable introspection.

cmake/setup_cached_variables.cmake
cmake/setup_write_config.cmake

index 95b336a0024205aca3460347c7099f44cb00b883..966a2a223a045fdccf23979bc8d636adbd113726 100644 (file)
@@ -76,17 +76,27 @@ If(DEAL_II_HAVE_DOC_DIRECTORY)
     "Enable configuration, build and installation of the documentation. This adds a COMPONENT \"documentation\" to the build system."
     OFF
     )
+  LIST(APPEND DEAL_II_COMPONENTS DOCUMENTATION)
+
 ENDIF()
 
 OPTION(DEAL_II_COMPONENT_EXAMPLES
   "Enable configuration and installation of the example steps. This adds a COMPONENT \"examples\" to the build system."
   ON
   )
+LIST(APPEND DEAL_II_COMPONENTS EXAMPLES)
+
+OPTION(DEAL_II_COMPONENT_PACKAGE
+  "Generates additional targets for packaging deal.II"
+  OFF
+  )
+LIST(APPEND DEAL_II_COMPONENTS PACKAGE)
 
 OPTION(DEAL_II_COMPONENT_PARAMETER_GUI
   "Build and install the parameter_gui. This adds a COMPONENT \"parameter_gui\" to the build system."
   OFF
   )
+LIST(APPEND DEAL_II_COMPONENTS PARAMETER_GUI)
 
 OPTION(DEAL_II_ALLOW_AUTODETECTION
   "Allow to automatically set up features by setting all undefined DEAL_II_WITH_* variables to ON or OFF"
@@ -98,11 +108,6 @@ OPTION(DEAL_II_FORCE_AUTODETECTION
   OFF
   )
 
-OPTION(DEAL_II_COMPONENT_PACKAGE
-  "Generates additional targets for packaging deal.II"
-  OFF
-  )
-
 
 ########################################################################
 #                                                                      #
index 638f81eab39374a0f6bb67273dd1a341b584698c..c87aa076c2240ed8ceb9ea13926751570d743c98 100644 (file)
@@ -230,21 +230,12 @@ _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}})
-      _both("#        ${_var}\n")
-      STRING(REPLACE "DEAL_II_COMPONENT_" "" _component ${_var})
-      LIST(APPEND _components ${_component})
-    ELSE()
-      _both("#      ( ${_var} = ${${_var}} )\n")
-    ENDIF()
+FOREACH(_component ${DEAL_II_COMPONENTS})
+  SET(_var DEAL_II_COMPONENT_${_component})
+  IF(${${_var}})
+    _both("#        ${_var}\n")
+  ELSE()
+    _both("#      ( ${_var} = ${${_var}} )\n")
   ENDIF()
 ENDFOREACH()
 

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.