]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Refactor feature setup
authorMatthias Maier <tamiko@43-1.org>
Sat, 5 Mar 2016 08:16:31 +0000 (02:16 -0600)
committerMatthias Maier <tamiko@43-1.org>
Fri, 18 Mar 2016 21:59:19 +0000 (16:59 -0500)
 - DEAL_II_FEATURES is now used to hold the short name of all configurable
   features

cmake/checks/check_01_cxx_features.cmake
cmake/macros/macro_configure_feature.cmake
cmake/setup_cached_variables.cmake
cmake/setup_finalize.cmake

index 6d94ea758056d6771e3c9ed28a8c4814e07af143..f43871d40c3e1eaf46e4298cf91d38c61b81b544 100644 (file)
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2012 - 2015 by the deal.II authors
+## Copyright (C) 2012 - 2016 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -366,11 +366,13 @@ OPTION(DEAL_II_WITH_CXX11
   "Compile deal.II using C++11 language standard."
   ${DEAL_II_HAVE_CXX11}
   )
+LIST(APPEND DEAL_II_FEATURES CXX11)
 
 OPTION(DEAL_II_WITH_CXX14
   "Compile deal.II using C++14 language standard."
   ${DEAL_II_HAVE_CXX14}
   )
+LIST(APPEND DEAL_II_FEATURES CXX14)
 
 #
 # Bail out if user requested C++11 support (DEAL_II_WITH_CXX11) but support
index c5cbf15f658e470527b70d90699c1b0d6a5252b6..2e3f076a430a608d0dda2107b4db7aae3eaec78a 100644 (file)
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2012 - 2015 by the deal.II authors
+## Copyright (C) 2012 - 2016 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -146,6 +146,12 @@ ENDMACRO()
 ########################################################################
 
 MACRO(CONFIGURE_FEATURE _feature)
+
+  #
+  # Register the feature in the DEAL_II_FEATURES list
+  #
+  LIST(APPEND DEAL_II_FEATURES ${_feature})
+
   #
   # This script is arcane black magic. But at least for the better good: We
   # don't have to copy the configuration logic to every single
@@ -222,7 +228,6 @@ MACRO(CONFIGURE_FEATURE _feature)
         IF(FEATURE_${_feature}_HAVE_BUNDLED)
           RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
           MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
-          LIST(APPEND DEAL_II_FEATURES ${_feature})
           SET(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE)
           SET_CACHED_OPTION(${_feature} ON)
         ELSE()
@@ -248,7 +253,6 @@ MACRO(CONFIGURE_FEATURE _feature)
           ENDIF()
 
           MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with external dependencies.")
-          LIST(APPEND DEAL_II_FEATURES ${_feature})
           SET(FEATURE_${_feature}_EXTERNAL_CONFIGURED TRUE)
           SET_CACHED_OPTION(${_feature} ON)
 
@@ -262,7 +266,6 @@ MACRO(CONFIGURE_FEATURE _feature)
             RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
 
             MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
-            LIST(APPEND DEAL_II_FEATURES ${_feature})
             SET(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE)
             SET_CACHED_OPTION(${_feature} ON)
 
index 8dff4ca139894d13adc93dc5e8c1def9adacde95..95b336a0024205aca3460347c7099f44cb00b883 100644 (file)
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2012 - 2015 by the deal.II authors
+## Copyright (C) 2012 - 2016 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -315,6 +315,7 @@ OPTION(DEAL_II_WITH_64BIT_INDICES
   "If set to ON, then use 64-bit data types to represent global degree of freedom indices. The default is to OFF. You only want to set this to ON if you will solve problems with more than 2^31 (approximately 2 billion) unknowns. If set to ON, you also need to ensure that both Trilinos and/or PETSc support 64-bit indices."
   OFF
   )
+LIST(APPEND DEAL_II_FEATURES 64BIT_INDICES)
 
 OPTION(DEAL_II_DOXYGEN_USE_MATHJAX
   "If set to ON, doxygen documentation is generated using mathjax"
index 6dd72d4658a6b1da6fda01bc40647685c39656ff..30fb87ca198e577bb3c83660e22643c5cf7c2aba 100644 (file)
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2012 - 2015 by the deal.II authors
+## Copyright (C) 2012 - 2016 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -62,8 +62,10 @@ ENDFOREACH()
 # Register features:
 #
 FOREACH(_feature ${DEAL_II_FEATURES})
-  FILTER_SYSTEM_LIBRARIES(${_feature}) # TODO, remove here
-  REGISTER_FEATURE(${_feature})
+  IF(DEAL_II_WITH_${_feature})
+    FILTER_SYSTEM_LIBRARIES(${_feature})
+    REGISTER_FEATURE(${_feature})
+  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.