From: Matthias Maier Date: Sat, 5 Mar 2016 08:51:21 +0000 (-0600) Subject: CMake: Use DEAL_II_FEATURES in config/CMakeLists.txt X-Git-Tag: v8.5.0-rc1~1199^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=891b877c3bf080632031cd88ce1894bf03ff3385;p=dealii.git CMake: Use DEAL_II_FEATURES in config/CMakeLists.txt This commit also rearranges the logic such that variables belonging to a certain features are grouped together again. --- diff --git a/cmake/config/CMakeLists.txt b/cmake/config/CMakeLists.txt index 26e582ee8a..d96cc86fab 100644 --- a/cmake/config/CMakeLists.txt +++ b/cmake/config/CMakeLists.txt @@ -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")