From 083ac1598a139226b79c74f58b82d98c9ed2222a Mon Sep 17 00:00:00 2001 From: maier Date: Sun, 31 Mar 2013 20:37:59 +0000 Subject: [PATCH] CMake: Add a schortcut for configuration: - WITH_* gets replaced by DEAL_II_WITH_* - COMPONENT_* gets replaced by DEAL_II_COMPONENT_* - Just providing a component name gets replaced by DEAL_II_COMPONENT_* git-svn-id: https://svn.dealii.org/trunk@29121 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/setup_cached_variables.cmake | 45 +++++++++++++++++----- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/deal.II/cmake/setup_cached_variables.cmake b/deal.II/cmake/setup_cached_variables.cmake index d22cedd0ef..27b2a53c5e 100644 --- a/deal.II/cmake/setup_cached_variables.cmake +++ b/deal.II/cmake/setup_cached_variables.cmake @@ -101,6 +101,7 @@ IF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") ) ENDIF() + ########################################################################### # # # Compilation and linking: # @@ -229,14 +230,40 @@ FOREACH(_flag ${DEAL_II_USED_FLAGS}) MARK_AS_ADVANCED(${_flag}) ENDFOREACH() -IF(DEAL_II_FORCE_AUTODETECTION) + +########################################################################### +# # +# Miscellanious setup: # +# # +########################################################################### + +GET_CMAKE_PROPERTY(_res VARIABLES) +FOREACH(_var ${_res}) # - # Undefine all feature toggles DEAL_II_WITH_* prior to configure: + # Rename WITH_* by DEAL_II_WITH_* # - GET_CMAKE_PROPERTY(_res VARIABLES) - FOREACH(_var ${_res}) - IF(_var MATCHES "DEAL_II_WITH_") - UNSET(${_var} CACHE) - ENDIF() - ENDFOREACH() -ENDIF() + IF(_var MATCHES "^WITH_") + SET(DEAL_II_${_var} ${${_var}} CACHE BOOL "" FORCE) + UNSET(${_var} CACHE) + ENDIF() + + # + # Same for components: + # + IF(_var MATCHES "^COMPONENT_") + SET(DEAL_II_${_var} ${${_var}} CACHE BOOL "" FORCE) + UNSET(${_var} CACHE) + ENDIF() + IF(_var MATCHES "^(COMPAT_FILES|DOCUMENTATION|EXAMPLES|CONTRIB)") + SET(DEAL_II_COMPONENT_${_var} ${${_var}} CACHE BOOL "" FORCE) + UNSET(${_var} CACHE) + ENDIF() + + # + # If DEAL_II_FORCE_AUTODETECTION is set undefine all feature toggles + # DEAL_II_WITH_* prior to configure: + # + IF(DEAL_II_FORCE_AUTODETECTION AND _var MATCHES "^DEAL_II_WITH_") + UNSET(${_var} CACHE) + ENDIF() +ENDFOREACH() -- 2.39.5