forces the use of the bundled library regardless whether
DEAL_II_ALLOW_BUNDLED is set to OFF or an external library is found.
-
- Autoconfiguration:
-
- If the option DEAL_II_FEATURE_AUTODETECTION is enabled the
- DEAL_II_WITH_<feature> toggles will be automatically set (overwriting any
- previous configuration) depending on whether they can be supported or
- not.
- (Note: DEAL_II_FEATURE_AUTODETECTION will respect DEAL_II_ALLOW_BUNDLED
- and DEAL_II_FORCE_BUNDLED_<feature>)
-
REMARKS:
- To ensure that no bundled library is used at all DEAL_II_ALLOW_BUNDLED,
separately.
+ Auto configuration:
+
+ As long as DEAL_II_WITH_<FEATURE> is not set to ON or OFF in the cache it
+ will be automatically configured. If a toggle DEAL_II_WITH_<FEATURE> is
+ defined it won't be altered.
+ This means that the very first configuration run will set all (at that
+ moment) available features to ON and the rest to OFF. In all subsequent
+ configuration steps DEAL_II_WITH_<FEATURE> have to be changed by hand.)
+
+ This behaviour can be controlled via the variables:
+
+ - DISABLE_AUTODETECTION=ON: This will disable any autoconfiguration by
+ setting undefined DEAL_II_WITH_<FEATURE> toggles to OFF:
+
+ - FORCE_AUTODETECTION=ON: This will force the reconfiguration of every
+ feature by undefining DEAL_II_WITH_<FEATURE> prior to configuration,
+ effectively overwriting _any_ supplied or cached value.
+
+
External library locations
==========================
# Configuration for mpi support:
#
-OPTION(DEAL_II_WITH_MPI
- "Build deal.II with support for mpi."
- OFF)
-
MACRO(FEATURE_MPI_FIND_EXTERNAL var)
FIND_PACKAGE(MPI)
# Configuration for tbb support:
#
-OPTION(DEAL_II_WITH_TBB
- "Build deal.II with support for tbb. This will enable thread support in deal.II."
- OFF)
-
#
# Set up genereal threading:
# Configuration for the ARPACK library:
#
-OPTION(DEAL_II_WITH_ARPACK
- "Build deal.II with support for arpack."
- OFF)
-
MACRO(FEATURE_ARPACK_FIND_EXTERNAL var)
FIND_PACKAGE(ARPACK)
# Configuration for doxygen
#
-OPTION(DEAL_II_WITH_DOXYGEN
- "Build deal.II with support for doxygen and dot."
- OFF)
-
MACRO(FEATURE_DOXYGEN_FIND_EXTERNAL var)
FIND_PACKAGE(Doxygen)
#
-OPTION(DEAL_II_WITH_LAPACK
- "Build deal.II with support for LAPACK."
- OFF)
-
-
MACRO(FEATURE_LAPACK_FIND_EXTERNAL var)
FIND_PACKAGE(LAPACK)
# Configuration for the netcdf library:
#
-OPTION(DEAL_II_WITH_METIS
- "Build deal.II with support for Metis."
- OFF)
-
MACRO(FEATURE_METIS_FIND_EXTERNAL var)
FIND_PACKAGE(METIS)
# Configuration for the MUMPS library:
#
-OPTION(DEAL_II_WITH_MUMPS
- "Build deal.II with support for MUMPS."
- OFF)
SET(FEATURE_MUMPS_DEPENDS DEAL_II_WITH_MPI)
# Configuration for the netcdf library:
#
-OPTION(DEAL_II_WITH_NETCDF
- "Build deal.II with support for netcdf."
- OFF)
-
MACRO(FEATURE_NETCDF_FIND_EXTERNAL var)
FIND_PACKAGE(NETCDF)
# Configuration for the p4est and sc libraries:
#
-OPTION(DEAL_II_WITH_P4EST
- "Build deal.II with support for p4est."
- OFF)
-
SET(FEATURE_P4EST_DEPENDS DEAL_II_WITH_MPI)
# Configuration for the petsc library:
#
-OPTION(DEAL_II_WITH_PETSC
- "Build deal.II with support for petsc."
- OFF)
-
MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
# Configuration for the trilinos library:
#
-OPTION(DEAL_II_WITH_TRILINOS
- "Build deal.II with support for trilinos."
- OFF)
-
MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
FIND_PACKAGE(TRILINOS)
# Configuration for the umfpack and amd libraries:
#
-OPTION(DEAL_II_WITH_UMFPACK
- "Build deal.II with support for UMFPACK."
- OFF)
-
MACRO(FEATURE_UMFPACK_FIND_EXTERNAL var)
FIND_PACKAGE(UMFPACK)
# Configuration for the zlib library:
#
-OPTION(DEAL_II_WITH_ZLIB
- "Build deal.II with support for zlib."
- OFF)
MACRO(FEATURE_ZLIB_FIND_EXTERNAL var)
FIND_PACKAGE(ZLIB)
# A small macro to set the DEAL_II_WITH_${feature} variables:
#
MACRO(SET_CACHED_OPTION str value)
- SET(${str}
+ STRING(TOLOWER "${str}" str_lower)
+ SET(DEAL_II_WITH_${str}
${value}
CACHE BOOL
- "Automatically set due to DEAL_II_FEATURE_AUTODETECTION"
+ "Build deal.II with support for ${str_lower}."
FORCE)
ENDMACRO()
ENDIF()
ENDFOREACH()
+
+ #
+ # Obey the user overrides:
+ #
+ IF(FORCE_AUTODETECTION)
+ UNSET(DEAL_II_WITH_${feature})
+ ENDIF()
+ IF(DISABLE_AUTODETECTION AND
+ (NOT DEFINED DEAL_II_WITH_${feature}) )
+ SET_CACHED_OPTION(${feature} OFF)
+ ENDIF()
+
+
#
- # Only try to configure ${feature} if we have to:
+ # Only try to configure ${feature} if we have to, i.e.
+ # DEAL_II_WITH_${feature} is set to true or not set at all.
#
- IF(DEAL_II_FEATURE_AUTODETECTION OR DEAL_II_WITH_${feature})
+ IF((NOT DEFINED DEAL_II_WITH_${feature}) OR
+ DEAL_II_WITH_${feature})
#
# Are all dependencies fullfilled?
SET(macro_dependencies_ok TRUE)
FOREACH(macro_dependency ${FEATURE_${feature}_DEPENDS})
IF(NOT ${macro_dependency})
- IF(DEAL_II_FEATURE_AUTODETECTION)
- MESSAGE(STATUS
+ IF(DEAL_II_WITH_${feature})
+ MESSAGE(SEND_ERROR "\n"
"DEAL_II_WITH_${feature} has unmet configuration requirements: "
- "${macro_dependency} has to be set to \"ON\"."
+ "${macro_dependency} has to be set to \"ON\".\n\n"
)
- SET_CACHED_OPTION(DEAL_II_WITH_${feature} OFF)
ELSE()
- MESSAGE(SEND_ERROR "\n"
+ MESSAGE(STATUS
"DEAL_II_WITH_${feature} has unmet configuration requirements: "
- "${macro_dependency} has to be set to \"ON\".\n\n"
+ "${macro_dependency} has to be set to \"ON\"."
)
+ SET_CACHED_OPTION(${feature} OFF)
ENDIF()
SET(macro_dependencies_ok FALSE)
ENDIF()
MESSAGE(STATUS
"DEAL_II_WITH_${feature} successfully set up with bundled packages."
)
- IF(DEAL_II_FEATURE_AUTODETECTION)
- SET_CACHED_OPTION(DEAL_II_WITH_${feature} ON)
- ENDIF()
+ SET_CACHED_OPTION(${feature} ON)
ELSE()
# This should not happen. So give an error
MESSAGE(SEND_ERROR
MESSAGE(STATUS
"DEAL_II_WITH_${feature} successfully set up with external dependencies."
)
- IF(DEAL_II_FEATURE_AUTODETECTION)
- SET_CACHED_OPTION(DEAL_II_WITH_${feature} ON)
- ENDIF()
+ SET_CACHED_OPTION(${feature} ON)
ELSE()
# This should not happen. So give an error
MESSAGE(SEND_ERROR
"DEAL_II_WITH_${feature} successfully set up with bundled packages."
)
IF(DEAL_II_FEATURE_AUTODETECTION)
- SET_CACHED_OPTION(DEAL_II_WITH_${feature} ON)
+ SET_CACHED_OPTION(${feature} ON)
ENDIF()
ELSE()
# This should not happen. So give an error
)
ENDIF()
ELSE()
- IF(DEAL_II_FEATURE_AUTODETECTION)
- SET_CACHED_OPTION(DEAL_II_WITH_${feature} OFF)
+ IF(DEAL_II_WITH_${feature})
+ IF(FEATURE_${feature}_CUSTOM_ERROR_MESSAGE)
+ RUN_COMMAND("FEATURE_${feature}_ERROR_MESSAGE()")
ELSE()
- IF(FEATURE_${feature}_CUSTOM_ERROR_MESSAGE)
- RUN_COMMAND("FEATURE_${feature}_ERROR_MESSAGE()")
- ELSE()
- FEATURE_ERROR_MESSAGE(${feature})
- ENDIF()
+ FEATURE_ERROR_MESSAGE(${feature})
ENDIF()
+ ELSE()
+ SET_CACHED_OPTION(${feature} OFF)
+ ENDIF()
ENDIF()
ENDIF(FEATURE_${feature}_EXTERNAL_FOUND)
- ENDIF(DEAL_II_FORCE_BUNDLED_${feature})
- ENDIF(macro_dependencies_ok)
- ENDIF(DEAL_II_FEATURE_AUTODETECTION OR DEAL_II_WITH_${feature})
+ ENDIF()
+ ENDIF()
+ ENDIF()
SET(FEATURE_${feature}_PROCESSED TRUE)
${MUMPS_DIR}
PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
)
+MARK_AS_ADVANCED(PORD_LIBRARY)
+
IF(NOT PORD_LIBRARY MATCHES "-NOTFOUND")
LIST(APPEND MUMPS_LIBRARIES
${PORD_LIBRARY}
#
# General configuration options:
#
-# DEAL_II_FEATURE_AUTODETECTION **)
# DEAL_II_ALLOW_BUNDLED **)
# DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS **)
# DEAL_II_COMPONENT_COMPAT_FILES **)
# DEAL_II_WITH_BUNDLED_DIRECTORY
# DEAL_II_WITH_DOC_DIRECTORY
#
-# *) Values marked with *) can be overwritten by the command line via
-# -D<...>
-# **) Cached Option. Can be set via ccmake or on the command line via
+# *) Uncached variables. Can be overwritten by the command line via
# -D<...>
+# **) Cached Options. Can be set via ccmake or on the command line via -D<...>
#
# #
###########################################################################
-OPTION(DEAL_II_FEATURE_AUTODETECTION
- "Enables feature autodetection. This will automatically set DEAL_II_WITH_<...> options."
- ON
- )
-
OPTION(DEAL_II_ALLOW_BUNDLED
"Allow the use of libraries bundled with the source tarball. (DEAL_II_FORCE_BUNDLED* will overwrite this option.)"
ON
FILE(APPEND ${log} "\nWARNING: Unknown compiler! Please set compiler flags by hand.\n")
ENDIF()
-
FILE(APPEND ${log}
"\nConfigured Features ("
- "DEAL_II_FEATURE_AUTODETECTION = ${DEAL_II_FEATURE_AUTODETECTION}, "
+ )
+IF(FORCE_AUTODETECTION)
+ FILE(APPEND ${log}
+ "!!! FORCE_AUTODETECTION !!!, "
+ )
+ENDIF()
+IF(DISABLE_AUTODETECTION)
+ FILE(APPEND ${log}
+ "!!! DISABLE_AUTODETECTION !!!, "
+ )
+ENDIF()
+FILE(APPEND ${log}
"DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}):\n"
)
+
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
IF(var MATCHES "DEAL_II_WITH")