#####
-#
-# The cmake build system for the deal.II project
-#
-
-###########################################################################
## ##
-## See README.cmake for further details on how to use the cmake build ##
-## system of deal.II. ##
+# #
+# The cmake build system for the deal.II project #
+# #
+# See README.cmake for further details on how to use the cmake build #
+# system of deal.II. #
+# #
## ##
-###########################################################################
-
-#
-# The main purpose of this file is to set all the configuration options and
-# then call a lot of modules residing under ./cmake/*/ that do the
-# hard work.
-#
###########################################################################
INCLUDE(setup_external_macros)
+#
+# Check whether the doc or bundled folder is available:
+#
+IF(EXISTS ${CMAKE_SOURCE_DIR}/bundled/CMakeLists.txt)
+ SET(DEAL_II_WITH_BUNDLED_DIRECTORY TRUE)
+ENDIF()
+
+IF(EXISTS ${CMAKE_SOURCE_DIR}/doc/CMakeLists.txt)
+ SET(DEAL_II_WITH_DOC_DIRECTORY TRUE)
+ENDIF()
+
#
# We have to initialize some cached variables before PROJECT is called, so
# do it at this point:
###########################################################################
# #
-# Compile and install the library: #
+# Compilation and installation: #
# #
###########################################################################
ADD_SUBDIRECTORY(examples)
ADD_SUBDIRECTORY(contrib)
-
#
# Define some custom targets for convenience
#
+++ /dev/null
-dnl -------------------------------------------------------------
-dnl Check for the Tecplot API. If it is found we will be able to write
-dnl Tecplot binary files directly.
-dnl
-dnl This is a little ugly since we aren't guaranteed that TECHOME
-dnl will point to the installation directory. It could just as
-dnl easily be TEC80HOME, TEC90HOME, etc... So, better check them all
-dnl
-dnl Usage: DEAL_II_CONFIGURE_TECPLOT
-dnl
-dnl -------------------------------------------------------------
-AC_DEFUN(DEAL_II_CONFIGURE_TECPLOT, dnl
-[
- for i [ in $TECHOME $TEC100HOME $TEC90HOME $TEC80HOME ] ; do
- AC_CHECK_FILE($i/lib/tecio.a,
- TECPLOT_LIB="$i/lib/tecio.a")
- AC_CHECK_FILE($i/include/TECIO.h,
- TECPLOT_INCLUDE_DIR=-I$i/include,
- TECPLOT_LIB="")
- if test "x$TECPLOT_LIB" != "x" ; then
- break
- fi
- done
-
- if (test -r "$TECPLOT_LIB") ; then
- AC_DEFINE(DEAL_II_HAVE_TECPLOT, 1,
- [Flag indicating whether the library shall be compiled to use the Tecplot interface])
- DEAL_II_ADD_EXTERNAL_LIBS_AT_FRONT($TECPLOT_LIB)
- fi
-])
#####
#
-# Setup cached variables prior to the PROJECT(deal.II) call
+# Setup cached variables (prior to the PROJECT(deal.II) call)
#
+# This file sets up the following cached Options:
+#
+# General configuration options:
+#
+# DEAL_II_ALLOW_BUNDLED
+# DEAL_II_COMPONENT_COMPAT_FILES
+# DEAL_II_COMPONENT_CONTRIB
+# DEAL_II_COMPONENT_DOCUMENTATION
+# DEAL_II_COMPONENT_EXAMPLES
+#
+# Options regarding compilation and linking:
+#
+# DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
+# CMAKE_BUILD_TYPE
+# BUILD_SHARED_LIBS
+# CMAKE_INSTALL_RPATH_USE_LINK_PATH
+# CMAKE_C_FLAGS *)
+# CMAKE_CXX_FLAGS *)
+# CMAKE_SHARED_LINKER_FLAGS *)
+# DEAL_II_C_FLAGS_DEBUG
+# DEAL_II_CXX_FLAGS_DEBUG
+# DEAL_II_SHARED_LINKER_FLAGS_DEBUG
+# DEAL_II_C_FLAGS_RELEASE
+# DEAL_II_CXX_FLAGS_RELEASE
+# DEAL_II_SHARED_LINKER_FLAGS_RELEASE
+#
+# *) May also be set via environment variable (CFLAGS, CXXFLAGS, LDFLAGS)
+#
+
+
+###########################################################################
+# #
+# General configuration options: #
+# #
+###########################################################################
+
+If(DEAL_II_WITH_BUNDLED_DIRECTORY)
+ OPTION(DEAL_II_ALLOW_BUNDLED
+ "Allow the use of libraries bundled with the source tarball. (DEAL_II_FORCE_BUNDLED* will overwrite this option.)"
+ ON
+ )
+ENDIF()
+OPTION(DEAL_II_COMPONENT_COMPAT_FILES
+ "Enable installation of the example steps. This adds a COMPONENT \"compat_files\" to the build system."
+ ON
+ )
+
+OPTION(DEAL_II_COMPONENT_CONTRIB
+ "Enable installation of contrib packages. This adds a COMPONENT \"contrib\" to the build system."
+ OFF
+ )
+
+If(DEAL_II_WITH_DOC_DIRECTORY)
+ OPTION(DEAL_II_COMPONENT_DOCUMENTATION
+ "Enable configuration, build and installation of the documentation. This adds a COMPONENT \"documentation\" to the build system."
+ OFF
+ )
+ENDIF()
+
+OPTION(DEAL_II_COMPONENT_EXAMPLES
+ "Enable configuration and installation of the example steps. This adds a COMPONENT \"examples\" to the build system."
+ ON
+ )
+
+
+###########################################################################
+# #
+# Compilation and linking: #
+# #
+###########################################################################
+
+OPTION(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
+ "configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target."
+ ON
+ )
+MARK_AS_ADVANCED(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
#
# Setup CMAKE_BUILD_TYPE:
"Choose the type of build, options are: Debug, Release and DebugRelease."
)
-
#
# This is cruel, I know. But it is better to only have a known number of
# options for CMAKE_BUILD_TYPE...
)
ENDIF()
-
-#
-# Set BUILD_SHARED_LIBS to default to ON and promote to cache so that the
-# user can see the value.
-#
SET(BUILD_SHARED_LIBS "ON" CACHE BOOL
"Build a shared library"
)
MARK_AS_ADVANCED(BUILD_SHARED_LIBS)
-
#
# Set CMAKE_INSTALL_RPATH_USE_LINK_PATH to default to ON and promote to
# cache so that the user can see the value.
)
MARK_AS_ADVANCED(CMAKE_INSTALL_RPATH_USE_LINK_PATH)
-
#
# Tell the user very prominently, that we're doing things differently w.r.t
# CMAKE_(C|CXX)_FLAGS_(DEBUG|RELEASE)
ENDIF()
ENDFOREACH()
-
#
# Hide all unused compiler flag variables:
#
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELWITHDEBINFO
)
- #
# Go away...
- #
SET(${_flag} "" CACHE INTERNAL "" FORCE)
ENDFOREACH()
-
#
# Read in CFLAGS, CXXFLAGS and LDFLAGS from environment
#
SET_IF_EMPTY(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS}")
SET_IF_EMPTY(CMAKE_SHARED_LINKER_FLAGS "$ENV{LDFLAGS}")
-
#
# Set cached compiler flags to an empty string:
#
)
FOREACH(_flag ${DEAL_II_USED_FLAGS})
-
#
- # "CACHE" ensures that we only set the variable if it is not already set
- # as a cached variable. Effectively we're setting a default value:
+ # Promote to cache:
#
SET(${_flag} "${${_flag}}" CACHE STRING
"The user supplied cache variable will be appended _at the end_ of the auto generated ${_flag} variable"
#####
#
-# Set up deal.II specific definitions and look for available components
+# Set up deal.II specific definitions
#
-# This file defines a long list of variables, used throughout the
+# This file defines a long list of uncached variables, used throughout the
# configuration to determine paths, locations and names:
#
-# General configuration options:
-#
-# DEAL_II_ALLOW_BUNDLED **)
-# DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS **)
-# DEAL_II_COMPONENT_COMPAT_FILES **)
-# DEAL_II_COMPONENT_CONTRIB **)
-# DEAL_II_COMPONENT_DOCUMENTATION **)
-# DEAL_II_COMPONENT_EXAMPLES **)
-#
# General information about deal.II:
#
# DEAL_II_PACKAGE_NAME *)
-# DEAL_II_PACKAGE_VERSION
-# DEAL_II_PACKAGE_BUGREPORT *)
-# DEAL_II_PACKAGE_URL *)
+# DEAL_II_PACKAGE_VERSION **)
# DEAL_II_VERSION_MAJOR
# DEAL_II_VERSION_MINOR
#
# DEAL_II_WITH_BUNDLED_DIRECTORY
# DEAL_II_WITH_DOC_DIRECTORY
#
-# *) 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<...>
-#
-# #) Set in source/CmakeLists.txt after the target names are known.
-#
-
-
-#
-# Check whether the doc or bundled folder is available:
+# *) Can be overwritten by the command line via -D<...>
+# **) Will be set with to the value of ${VERSION}
#
-IF(EXISTS ${CMAKE_SOURCE_DIR}/bundled/CMakeLists.txt)
- SET(DEAL_II_WITH_BUNDLED_DIRECTORY TRUE)
-ENDIF()
-
-IF(EXISTS ${CMAKE_SOURCE_DIR}/doc/CMakeLists.txt)
- SET(DEAL_II_WITH_DOC_DIRECTORY TRUE)
-ENDIF()
-
-
-###########################################################################
-# #
-# General configuration options: #
-# #
-###########################################################################
-
-OPTION(DEAL_II_ALLOW_BUNDLED
- "Allow the use of libraries bundled with the source tarball. (DEAL_II_FORCE_BUNDLED* will overwrite this option.)"
- ON
- )
-
-#
-# Build configuration: configuration options regarding compilation and
-# installation of the deal.II library
-#
-OPTION(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
- "configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target."
- ON
- )
-MARK_AS_ADVANCED(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
-
-#
-# Component selection: configuration options regarding the setup of
-# different components of the deal.II library
-#
-
-OPTION(DEAL_II_COMPONENT_COMPAT_FILES
- "Enable installation of the example steps. This adds a COMPONENT \"compat_files\" to the build system."
- ON
- )
-
-OPTION(DEAL_II_COMPONENT_CONTRIB
- "Enable installation of contrib packages. This adds a COMPONENT \"contrib\" to the build system."
- OFF
- )
-
-OPTION(DEAL_II_COMPONENT_EXAMPLES
- "Enable configuration and installation of the example steps. This adds a COMPONENT \"examples\" to the build system."
- ON
- )
-
-If(DEAL_II_WITH_DOC_DIRECTORY)
- OPTION(DEAL_II_COMPONENT_DOCUMENTATION
- "Enable configuration, build and installation of the documentation. This adds a COMPONENT \"documentation\" to the build system."
- OFF
- )
-ENDIF()
-
###########################################################################
# #
SET(DEAL_II_PACKAGE_VERSION ${VERSION})
-SET_IF_EMPTY(DEAL_II_PACKAGE_BUGREPORT "dealii@dealii.org")
-SET_IF_EMPTY(DEAL_II_PACKAGE_URL "http://www.dealii.org/")
-
STRING(REGEX REPLACE
"^([0-9]+)\\..*" "\\1" DEAL_II_VERSION_MAJOR "${VERSION}"
)
SET_IF_EMPTY(DEAL_II_PROJECT_CONFIG_RELDIR "${DEAL_II_LIBRARY_RELDIR}/cmake/${DEAL_II_PROJECT_CONFIG_NAME}")
ELSE()
#
- # IF DEAL_II_COMPONENT_COMPAT_FILES is not set, we assume that we have to
+ # IF DEAL_II_COMPONENT_COMPAT_FILES=off, we assume that we have to
# obey the FSHS...
#
SET_IF_EMPTY(DEAL_II_CMAKE_MACROS_RELDIR "share/${DEAL_II_PACKAGE_NAME}/cmake/Macros")
"${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}"
)
-
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
LIST(APPEND DEAL_II_BUILD_TYPES "DEBUG")
ENDIF()
#
# Cleanup some files used for storing the names of alle object targets that
-# will be bundled to the deal.II library. (Right now, i.e. cmake 2.8.8,
-# this is the only reliable way to get information in a global scope...)
+# will be bundled to the deal.II library.
+# (Right now, i.e. cmake 2.8.8, this is the only reliable way to get
+# information into a global scope...)
#
FOREACH(_build ${DEAL_II_BUILD_TYPES})
STRING(TOLOWER "${_build}" _build_lowercase)
##
#####
-#
-# Finalize the configuration:
-#
+###########################################################################
+# #
+# Finalize the configuration: #
+# #
+###########################################################################
#
# Hide some cmake specific cached variables. This is annoying...
#
MARK_AS_ADVANCED(file_cmd)
-
#
# Append the saved initial (cached) variables ${flags}_SAVED at the end of
# ${flags}, see setup_cached_compiler_flags.cmake and the main
STRING(STRIP "${${_flags}}" ${_flags})
ENDFOREACH()
-
#
# Depulicate entries in DEAL_II_EXTERNAL_LIBRARIES(_...):
#
ENDFOREACH()
-#
-# And write a nice configuration summary to file:
-#
-SET(_log "${CMAKE_BINARY_DIR}/summary.log")
+###########################################################################
+# #
+# And write a nice configuration summary to file: #
+# #
+###########################################################################
+SET(_log "${CMAKE_BINARY_DIR}/summary.log")
FILE(WRITE ${_log}
-"* * * *
-* * deal.II configuration: * *
-* * * *\n
+"#
+# deal.II configuration:
+#
CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}
CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}
CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}
ENDIF()
FILE(APPEND ${_log}
- "\nConfigured Features ("
+ "\nConfigured Features:"
)
IF(FORCE_AUTODETECTION)
FILE(APPEND ${_log}
- "!!! FORCE_AUTODETECTION !!!, "
+ " !!! FORCE_AUTODETECTION !!!"
)
ENDIF()
IF(DISABLE_AUTODETECTION)
FILE(APPEND ${_log}
- "!!! DISABLE_AUTODETECTION !!!, "
+ " !!! DISABLE_AUTODETECTION !!!"
+ )
+ENDIF()
+IF(DEFINED DEAL_II_ALLOW_BUNDLED)
+ FILE(APPEND ${_log}
+ " (DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED})"
)
ENDIF()
-FILE(APPEND ${_log}
- "DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}):\n"
- )
+
+FILE(APPEND ${_log} "\n")
GET_CMAKE_PROPERTY(_res VARIABLES)
FOREACH(_var ${_res})
ENDIF()
ENDFOREACH()
-
FILE(APPEND ${_log}
"\nComponent configuration:\n"
)
//
// TODO: Header
//
+// Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
+//
//---------------------------- config.h.in ---------------------------
#ifndef __deal2__config_h
#define DEAL_II_NAMESPACE_CLOSE }
-/* Define to the full name of this package. */
-#define DEAL_II_PACKAGE_NAME "@DEAL_II_PACKAGE_NAME@"
+/**************************************
+ * Configured in setup_deal_ii.cmake: *
+ **************************************/
-/* Define to the one symbol short name of this package. */
-#define DEAL_II_PACKAGE_TARNAME "@DEAL_II_PACKAGE_TARNAME@"
+/* Defined to the full name of this package. */
+#define DEAL_II_PACKAGE_NAME "@DEAL_II_PACKAGE_NAME@"
-/* Define to the version of this package. */
+/* Defined to the version of this package. */
#define DEAL_II_PACKAGE_VERSION "@DEAL_II_PACKAGE_VERSION@"
-/* Define to the address where bug reports for this package should be sent. */
-#define DEAL_II_PACKAGE_BUGREPORT "@DEAL_II_PACKAGE_BUGREPORT@"
-
-/* Define to the home page for this package. */
-#define DEAL_II_PACKAGE_URL "@DEAL_II_PACKAGE_URL@"
-
/* Major version number of deal.II */
#define DEAL_II_VERSION_MAJOR @DEAL_II_VERSION_MAJOR@
#define DEAL_II_VERSION_MINOR @DEAL_II_VERSION_MINOR@
-
-
/*****************************************
* Configured in configure_arpack.cmake: *
*****************************************/
/***************************************
* Configured in configure_hdf5.cmake: *
- **************************************/
+ ***************************************/
/* Defined if deal.II was configured with hdf5 support */
#cmakedefine DEAL_II_HAVE_HDF5
/*****************************************
- * Configured in configure_mumps.cmake: *
+ * Configured in configure_mumps.cmake: *
*****************************************/
/* Defined if an MUMPS installation was found and is going to be used */
#cmakedefine HAVE_TIMES
-/* Defined if the deal.II was configured on a native Windows platform. */
+/* Defined if deal.II was configured on a native Windows platform. */
#cmakedefine DEAL_II_MSVC
+/* Disable a bunch of warnings for Microsoft Visual C++. */
+#ifdef DEAL_II_MSVC
+# pragma warning( disable : 4244 ) /* implied downcasting from double to float */
+# pragma warning( disable : 4267 ) /* implied downcasting from size_t to unsigned int */
+# pragma warning( disable : 4996 ) /* unsafe functions, such as strcat and sprintf */
+# pragma warning( disable : 4355 ) /* 'this' : used in base member initializer list */
+# pragma warning( disable : 4661 ) /* no suitable definition provided for explicit template instantiation request */
+# pragma warning( disable : 4800 ) /* forcing value to bool 'true' or 'false' (performance warning) */
+# pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
+# pragma warning( disable : 4667 ) /* no function template defined that matches forced instantiation */
+# pragma warning( disable : 4520 ) /* multiple default constructors specified */
+# pragma warning( disable : 4700 ) /* uninitialized local variable */
+# pragma warning( disable : 4789 ) /* destination of memory copy is too small */
+# pragma warning( disable : 4808 ) /* case 'value' is not a valid value for switch condition of type 'bool */
+#endif // DEAL_II_MSVC
#include <deal.II/base/numbers.h>
by the preprocessor variable. */
#cmakedefine NO_HAVE_GETRUSAGE
-
-OBSOLETE:
-
-/* Define to 1 if you have the <Amesos.h> header file. */
-#cmakedefine HAVE_AMESOS_H # obosolete?!
-
-/* Define to 1 if you have the <AztecOO.h> header file. */
-#cmakedefine HAVE_AZTECOO_H # obosolete?!
-
-/* Define to 1 if you have the <AztecOO_Operator.h> header file. */
-#cmakedefine HAVE_AZTECOO_OPERATOR_H # obosolete?!
-
-/* Define to 1 if you have the <Epetra_CrsGraph.h> header file. */
-#cmakedefine HAVE_EPETRA_CRSGRAPH_H # obosolete?!
-
-/* Define to 1 if you have the <Epetra_CrsMatrix.h> header file. */
-#cmakedefine HAVE_EPETRA_CRSMATRIX_H # obosolete?!
-
-/* Define to 1 if you have the <Epetra_Import.h> header file. */
-#cmakedefine HAVE_EPETRA_IMPORT_H # obosolete?!
-
-/* Define to 1 if you have the <Epetra_LinearProblem.h> header file. */
-#cmakedefine HAVE_EPETRA_LINEARPROBLEM_H # obosolete?!
-
-/* Define to 1 if you have the <Epetra_Map.h> header file. */
-#cmakedefine HAVE_EPETRA_MAP_H # obosolete?!
-
-/* Define to 1 if you have the <Epetra_MultiVector.h> header file. */
-#cmakedefine HAVE_EPETRA_MULTIVECTOR_H # obosolete?!
-
-/* Define to 1 if you have the <Epetra_Operator.h> header file. */
-#cmakedefine HAVE_EPETRA_OPERATOR_H # obosolete?!
-
-/* Define to 1 if you have the <Epetra_SerialComm.h> header file. */
-#cmakedefine HAVE_EPETRA_SERIALCOMM_H # obosolete?!
-
-/* Define to 1 if you have the <Epetra_Vector.h> header file. */
-#cmakedefine HAVE_EPETRA_VECTOR_H # obosolete?!
-
-/* Define to 1 if you have the <Ifpack.h> header file. */
-#cmakedefine HAVE_IFPACK_H # obsolete?!
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#cmakedefine HAVE_INTTYPES_H # obsolete?!
-
-/* Define to 1 if you have the <memory.h> header file. */
-#cmakedefine HAVE_MEMORY_H # obsolete?!
-
-/* Define to 1 if you have the <ml_MultiLevelPreconditioner.h> header file. */
-#cmakedefine HAVE_ML_MULTILEVELPRECONDITIONER_H
-
-/* Define to 1 if you have the <Sacado.hpp> header file. */
-#cmakedefine HAVE_SACADO_HPP # obsolete?!
-
-/* Define to 1 if you have the <Teuchos_ParameterList.hpp> header file. */
-#cmakedefine HAVE_TEUCHOS_PARAMETERLIST_HPP # obsolete?!
-
-/* Define to 1 if you have the <Teuchos_RCP.hpp> header file. */
-#cmakedefine HAVE_TEUCHOS_RCP_HPP # obsolete?!
-
-/* Define to 1 if you have the <Teuchos_RefCountPtr.hpp> header file. */
-#cmakedefine HAVE_TEUCHOS_REFCOUNTPTR_HPP # obsolete?!
-
-
-
-TODO:
-
-
-
-/**
- * A #define that indicates whether we are using the Microsoft
- * Windows Visual C/C++ compiler. We currently do not run ./configure
- * on MS Windows, so the detection for this compiler happens via
- * the appropriate #ifdef, not through a configuration testcase.
- */
-#ifdef _MSC_VER
-# define DEAL_II_MSVC
-#endif
-
-/**
- * Using pthreads under windows as a non-static library requires the following
- * preprocessor switch to be undefined.
- */
-#ifdef DEAL_II_MSVC
-# if defined(PTW32_STATIC_LIB)
-# undef PTW32_STATIC_LIB
-# endif
-#endif
-
-
-#include <deal.II/base/numbers.h>
-#include <deal.II/base/types.h>
-
-// Disable a bunch of warnings for Microsoft Visual C++. We should
-// work on reducing this list over time to those that are truly
-// harmless and not indicative of actual problems
-#ifdef DEAL_II_MSVC
-# pragma warning( disable : 4244 ) // implied downcasting from double to float
-# pragma warning( disable : 4267 ) // implied downcasting from size_t to unsigned int
-# pragma warning( disable : 4996 ) // unsafe functions, such as strcat and sprintf
-# pragma warning( disable : 4355 ) // 'this' : used in base member initializer list
-# pragma warning( disable : 4661 ) // no suitable definition provided for explicit template instantiation request
-# pragma warning( disable : 4800 ) // forcing value to bool 'true' or 'false' (performance warning)
-# pragma warning( disable : 4146 ) // unary minus operator applied to unsigned type, result still unsigned
-# pragma warning( disable : 4667 ) // no function template defined that matches forced instantiation
-# pragma warning( disable : 4520 ) // multiple default constructors specified
-# pragma warning( disable : 4700 ) // uninitialized local variable
-# pragma warning( disable : 4789 ) // destination of memory copy is too small
-# pragma warning( disable : 4808 ) // case 'value' is not a valid value for switch condition of type 'bool
-#endif // DEAL_II_MSVC