From: Matthias Maier Date: Sat, 5 Mar 2016 08:27:46 +0000 (-0600) Subject: CMake: Use DEAL_II_FEATURES in setup_write_config.cmake X-Git-Tag: v8.5.0-rc1~1199^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4039abc82466bd7a1ff26c128dffeac67bfe6ba6;p=dealii.git CMake: Use DEAL_II_FEATURES in setup_write_config.cmake This is a first step to avoid the variables introspection done in this setup file. --- diff --git a/cmake/setup_write_config.cmake b/cmake/setup_write_config.cmake index c458b72f35..638f81eab3 100644 --- a/cmake/setup_write_config.cmake +++ b/cmake/setup_write_config.cmake @@ -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}})