#
# Obey the user overrides:
#
- IF( FORCE_AUTODETECTION AND
- (NOT "{_feature}" STREQUAL "BOOST") ) # TODO: Refactor this!
- UNSET(DEAL_II_WITH_${_feature} CACHE)
- ENDIF()
- IF(DISABLE_AUTODETECTION AND
- (NOT DEFINED DEAL_II_WITH_${_feature}) )
+ IF( (NOT DEAL_II_ALLOW_AUTODETECTION) AND
+ (NOT DEFINED DEAL_II_WITH_${_feature}) )
SET_CACHED_OPTION(${_feature} OFF)
ENDIF()
# DEAL_II_COMPONENT_CONTRIB
# DEAL_II_COMPONENT_DOCUMENTATION
# DEAL_II_COMPONENT_EXAMPLES
-# CMAKE_INSTALL_PREFIX **)
+# DEAL_II_ALLOW_AUTODETECTION
+# DEAL_II_FORCE_AUTODETECTION
#
# Options regarding compilation and linking:
#
# (nonempty cached variable has precedence will not be overwritten by
# environment)
#
-# **) for an in-source build (and if DISABLE_AUTOPILOT is not set)
-#
###########################################################################
ON
)
-#
-# Set CMAKE_INSTALL_PREFIX to the source directory if an in source build is
-# detected (and DISABLE_AUTOPILOT is not set)
-#
-IF( "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" AND
- NOT DISABLE_AUTOPILOT)
- SET(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}" CACHE STRING
- "Install path prefix, prepended onto install directories."
- )
-ENDIF()
+OPTION(DEAL_II_ALLOW_AUTODETECTION
+ "Allow to automatically setup features by setting all undefined DEAL_II_WITH_* variables to ON or OFF"
+ ON
+ )
+
+OPTION(DEAL_II_FORCE_AUTODETECTION
+ "Force feature autodetection by undefining all DEAL_II_WITH_* variables prior to configure"
+ OFF
+ )
###########################################################################
MARK_AS_ADVANCED(${_flag})
ENDFOREACH()
+IF(DEAL_II_FORCE_AUTODETECTION)
+ #
+ # Undefine all feature toggles DEAL_II_WITH_* prior to configure:
+ #
+ GET_CMAKE_PROPERTY(_res VARIABLES)
+ FOREACH(_var ${_res})
+ IF(_var MATCHES "DEAL_II_WITH_")
+ UNSET(${_var} CACHE)
+ ENDIF()
+ ENDFOREACH()
+ENDIF()
ENDIF()
FILE(APPEND ${_log}
- "#\n# Configured Features:"
+ "#\n# Configured Features ("
)
-IF(FORCE_AUTODETECTION)
+IF(DEFINED DEAL_II_ALLOW_BUNDLED)
FILE(APPEND ${_log}
- " !!! FORCE_AUTODETECTION !!!"
+ "DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}, "
)
ENDIF()
-IF(DISABLE_AUTODETECTION)
+IF(DEAL_II_FORCE_AUTODETECTION)
FILE(APPEND ${_log}
- " !!! DISABLE_AUTODETECTION !!!"
+ "!!! DEAL_II_FORCE_AUTODETECTION=ON !!!, "
)
ENDIF()
-IF(DEFINED DEAL_II_ALLOW_BUNDLED)
- FILE(APPEND ${_log}
- " (DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED})"
- )
-ENDIF()
-FILE(APPEND ${_log} "\n")
+FILE(APPEND ${_log}
+ "DEAL_II_ALLOW_AUTODETECTION = ${DEAL_II_ALLOW_AUTODETECTION}):\n"
+ )
GET_CMAKE_PROPERTY(_res VARIABLES)
FOREACH(_var ${_res})