+
+
+###########################################################################
+## ##
+## See README.cmake for further details on how to use the cmake build ##
+## system of deal.II. ##
+## ##
+###########################################################################
+
+
+
+
SET(VERSION "8.0.pre")
+
+
+
#
# This is the main CMakeLists.txt file for the deal.II project
+# ============================================================
#
# 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.
#
-#
-# Note: All further explained options can be either set via ccmake or at
-# the promp via:
-#
-# $ cmake -D<OPTION>=<VALUE> [...] path/to/source/tree
-#
-#
-# The first bunch of options of type DEAL_II_WITH_<feature> are for
-# configuration of the various features of the deal.II library.
-# An enabled feature will usually add one ore more dependencies to external
-# or 'contrib' (i.e. bundled with deal.II and residing under ./contrib/)
-# libraries.
-#
-#
-# The option DEAL_II_ALLOW_CONTRIB determines the behaviour of the
-# dependency resolution:
-#
-# - If set to ON external libraries still have precedence. But if there is
-# no external library the bundled contrib library will be used.
-#
-# - If set to OFF the contrib libraries will not be used and the dependency
-# resolution will fail if there is no external library. EXCEPT (there is
-# always an exception, isn't it?) DEAL_II_FORCE_CONTRIB_<library> forces
-# the use of the bundled contrib library.
-#
-#
-# 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_CONTRIB
-# and DEAL_II_FORCE_CONTRIB_<library>)
-#
-#
-# The option DEAL_II_FORCE_CONTRIB_<library> forces the use of the bundled
-# contrib library regardless whether DEAL_II_ALLOW_CONTRIB is set to OFF or
-# an external library is found.
-#
-# REMARKS:
-#
-# - To ensure that no bundled library is used at all DEAL_II_ALLOW_CONTRIB,
-# as well as every DEAL_II_FORCE_CONTRIB_<library> have to be set to OFF.
-#
-# - DEAL_II_FORCE_CONTRIB_<library>=ON will _not_ automatically enable the
-# corresponding DEAL_II_WITH_<feature> toggle. This has to be set
-# separately.
-#
-#
-# And, last but not least, CMAKE_BUILD_TYPES:
-#
-# We support the "Debug" and "Release" build targets. Default is the
-# "Release" target.
-#
-# - Debug will enable a lot of debug code paths and Assertions, as well as
-# compiling the library with a suitable set of debug compiler flags.
-#
-# - Release will chose a suitable set of optimizing flags.
-#
-#
-# deal.II will configure sensible default CFLAGS and CXXFLAGS depending on
-# platform, compiler and build target. There are two options, if this is
-# not desired:
-#
-# - Option 1: Disable the configuration completely by setting
-# DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS to OFF.
-# Beware of the fact that certain features may still pull in necessary
-# compiler flags.
-#
-# - Option 2: Overwrite the default configuration by setting the following
-# cached variables:
-#
-# CMAKE_CXX_FLAGS - used during all builds
-# CMAKE_CXX_FLAGS_DEBUG - additional flags used during debug builds
-# CMAKE_CXX_FLAGS_RELEASE - additional flags used during release builds
-# (same for CMAKE_C_...)
-#
-# The content of the cached variables will be preserved and added
-# *_TO THE END_* of the default compiler flags, hence giving a possibility
-# for overwriting a flag. E.g.: -Wsign-compare, set by the build system,
-# can be overwritten by specifying:
-#
-# $ cmake -DCMAKE_CXX_FLAGS="-Wno-sign-compare" <...>
-#
-#
-# Build options:
-#
-# - BUILD_SHARED_LIBS and
-# - DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
-#
-# Installation:
-#
-# - DEAL_II_INSTALL_EXAMPLES
-# - DEAL_II_INSTALL_COMPAT_FILES
-# - DEAL_II_INSTALL_PROJECT_CONFIG
-#
-# - Explain Components and Options...
-# - Explain how to build and install only a specific component:
-#
-# $ make <component>
-# $ cmake -DCOMPONENT=<component> -P build/cmake_install.cmake
-#
compiler flag setup."
ON)
-OPTION(DEAL_II_INSTALL_EXAMPLES
- "Enable the installation of the example steps.
- This feature adds a COMPONENT \"examples\" to the build system."
+#
+# Component selection: configuration options regarding the setup of
+# different components of the deal.II library
+#
+
+OPTION(DEAL_II_COMPONENT_EXAMPLES
+ "Enable configuration and installation of the example steps.
+ This adds a COMPONENT \"examples\" to the build system."
ON)
-OPTION(DEAL_II_INSTALL_COMPAT_FILES
- "Enable the installation of the example steps.
- This feature adds a COMPONENT \"compat_files\" to the build system."
+OPTION(DEAL_II_COMPONENT_DOCUMENTATION
+ "Enable configuration, build and installation of the documentation.
+ This adds a COMPONENT \"documentation\" to the build system."
+ OFF)
+
+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_INSTALL_PROJECT_CONFIG
- "Enable the installation of a cmake project config. Useful for
+OPTION(DEAL_II_COMPONENT_PROJECT_CONFIG
+ "Enable configuration and installation of a cmake project config. Useful for
autodetection ( FIND_PACKAGE(DEAL_II) ) of the deal.II library out of
cmake build systems.
- This feature adds a COMPONENT \"project_config\" to the build system."
+ This adds a COMPONENT \"project_config\" to the build system."
ON)
+++ /dev/null
-For installation instructions and further information,
-please see
- ./doc/readme.html
-which you can also reach through the main page
- ./doc/index.html
-
-
-For the very impatient: just type
- ./configure
- make all
--- /dev/null
+
+
+
+ ==============================================
+
+ The cmake build system for the deal.II project
+
+ ==============================================
+
+ Author: maier, 2012
+
+
+
+
+Table of contents
+=================
+
+The philosophy
+
+Quick start
+
+Useful bits
+
+Feature configuration
+
+Build configuration
+
+Installation
+
+Component selection
+
+
+
+
+The philosophy
+==============
+
+ »I need a new keyboard, my CAPS-KEY is stuck because of writing all
+ this cmake script...«
+
+
+
+
+Quick start
+===========
+
+
+* Make a build directory, configure, compile and install:
+
+ $ mkdir build
+ $ cd build
+ $ cmake -DCMAKE_INSTALL_PREFIX=/path/install/dir ../
+ $ make
+ $ make install
+
+
+
+
+Useful bits
+===========
+
+
+* All cached variables can be either set via
+
+ ( $ cd build )
+ $ ccmake
+
+ or at the prompt via:
+
+ ( $ cd build )
+ $ cmake -D<OPTION>=<VALUE> [...] path/to/source/tree
+
+
+* Build and install only a specific component:
+
+ $ cd build
+ $ make <component>
+ $ cmake -DCOMPONENT=<component> -P build/cmake_install.cmake
+
+
+
+
+Feature configuration
+=====================
+
+TODO: Reformulate
+
+The first bunch of options of type DEAL_II_WITH_<feature> are for
+configuration of the various features of the deal.II library.
+An enabled feature will usually add one ore more dependencies to external
+or 'contrib' (i.e. bundled with deal.II and residing under ./contrib/)
+libraries.
+
+
+The option DEAL_II_ALLOW_CONTRIB determines the behaviour of the
+dependency resolution:
+
+- If set to ON external libraries still have precedence. But if there is
+ no external library the bundled contrib library will be used.
+
+- If set to OFF the contrib libraries will not be used and the dependency
+ resolution will fail if there is no external library. EXCEPT (there is
+ always an exception, isn't it?) DEAL_II_FORCE_CONTRIB_<library> forces
+ the use of the bundled contrib library.
+
+
+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_CONTRIB
+and DEAL_II_FORCE_CONTRIB_<feature>)
+
+
+The option DEAL_II_FORCE_CONTRIB_<library> forces the use of the bundled
+contrib library regardless whether DEAL_II_ALLOW_CONTRIB is set to OFF or
+an external library is found.
+
+REMARKS:
+
+- To ensure that no bundled library is used at all DEAL_II_ALLOW_CONTRIB,
+ as well as every DEAL_II_FORCE_CONTRIB_<library> have to be set to OFF.
+
+- DEAL_II_FORCE_CONTRIB_<library>=ON will _not_ automatically enable the
+ corresponding DEAL_II_WITH_<feature> toggle. This has to be set
+ separately.
+
+TODO: A list of all DEAL_II_WITH_* options
+
+
+
+
+Build configuration
+===================
+
+
+CMAKE_BUILD_TYPES: We support the "Debug" and "Release" build targets.
+Default is the "Release" target.
+
+- Debug will enable a lot of debug code paths and Assertions, as well as
+ compiling the library with a suitable set of debug compiler flags.
+
+- Release will chose a suitable set of optimizing flags.
+
+
+deal.II will configure sensible default CFLAGS and CXXFLAGS depending on
+platform, compiler and build target. There are two options, if this is
+not desired:
+
+- Option 1: Disable the configuration completely by setting
+ DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS to OFF.
+ Beware of the fact that certain features may still pull in necessary
+ compiler flags.
+
+- Option 2: Overwrite the default configuration by setting the following
+ cached variables:
+
+ CMAKE_CXX_FLAGS - used during all builds
+ CMAKE_CXX_FLAGS_DEBUG - additional flags used during debug builds
+ CMAKE_CXX_FLAGS_RELEASE - additional flags used during release builds
+ (same for CMAKE_C_...)
+
+The content of the cached variables will be preserved and added
+*_TO THE END_* of the default compiler flags, hence giving a possibility
+for overwriting a flag. E.g.: -Wsign-compare, set by the build system,
+can be overwritten by specifying:
+
+ $ cmake -DCMAKE_CXX_FLAGS="-Wno-sign-compare" <...>
+
+
+The build can be further controlled by the following variables:
+
+- BUILD_SHARED_LIBS: If set, deal.II will be linked as a shared library
+
+- CMAKE_INSTALL_RPATH_USE_LINK_PATH: If set, the deal.II library will be
+ installed with its rpath value set to point to all libraries outside of
+ the system search pathes.
+
+
+
+
+Component selection
+===================
+
+
+The following options control which components of the deal.II shall be
+configured, build and installed:
+
+- DEAL_II_COMPONENT_EXAMPLES:
+ Enable configuration and installation of the example steps.
+ This adds a COMPONENT "examples" to the build system.
+
+- DEAL_II_COMPONENT_DOCUMENTATION:
+ Enable configuration, build and installation of the documentation.
+ This adds a COMPONENT "documentation" to the build system.
+
+- DEAL_II_COMPONENT_COMPAT_FILES:
+ Enable installation of legacy files and tools for compatibility with
+ the old build system
+ This adds a COMPONENT "compat_files" to the build system.
+
+- DEAL_II_COMPONENT_PROJECT_CONFIG:
+ Enable configuration and installation of a cmake project config. Useful
+ for finding ( FIND_PACKAGE(DEAL_II) ) the deal.II library out of cmake
+ build systems. This adds a COMPONENT "project_config" to the build
+ system.
+
+
+
+
+Installation
+============
+
+CMAKE_INSTALL_PREFIX determines the location, where the deal.II library
+will be installed.
+
+Please note that depending on whether DEAL_II_COMPONENT_COMPAT_FILES is
+set, there will be different folder structures:
+
+With DEAL_II_COMPONENT_COMPAT_FILES=ON:
+
+${CMAKE_INSTALL_PREFIX}/
+ common
+ common/scripts
+ doc
+ examples
+ include
+ lib
+
+With DEAL_II_COMPONENT_COMPAT_FILES=OFF:
+
+${CMAKE_INSTALL_PREFIX}/
+ include
+ lib${LIB_SUFFIX}
+ /share/doc/deal.II/examples
+ /share/doc/deal.II/html
+
+If DEAL_II_COMPONENT_COMPAT_FILES is set to OFF, the individual target
+directories can be overwritten by
+ DEAL_II_DOCUMENTATION_RELDIR
+ DEAL_II_EXAMPLES_RELDIR
+ DEAL_II_INCLUDE_RELDIR
+ DEAL_II_LIBRARY_RELDIR
+ DEAL_II_PROJECT_CONFIG_RELDIR
+
+
+
+
#
# Set BUILD_SHARED_LIBS to default to ON:
#
-SET(BUILD_SHARED_LIBS "ON" CACHE BOOL "Build a shared library")
+SET(BUILD_SHARED_LIBS "ON" CACHE BOOL
+ "Build a shared library"
+ )
+
+
+#
+# Set CMAKE_INSTALL_RPATH_USE_LINK_PATH to default to ON:
+#
+SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE BOOL
+ "Set the rpath of the library to the external link pathes on installation
+ ")
#
ADD_DEPENDENCIES(library deal_II)
-IF(DEAL_II_WITH_DOXYGEN)
+IF(DEAL_II_COMPONENT_DOCUMENTATION)
ADD_CUSTOM_TARGET(documentation)
ADD_DEPENDENCIES(documentation doxygen)
ENDIF()
-IF(DEAL_II_INSTALL_COMPAT_FILES)
+IF(DEAL_II_COMPONENT_COMPAT_FILES)
ADD_CUSTOM_TARGET(compat_files)
+ ADD_DEPENDENCIES(compat_files
+ expand_instantiations
+ make_dependencies
+ report_features
+ )
ENDIF()
-IF(DEAL_II_INSTALL_PROJECT_CONFIG)
+IF(DEAL_II_COMPONENT_PROJECT_CONFIG)
ADD_CUSTOM_TARGET(project_config)
SET(DEAL_II_PATH ${CMAKE_INSTALL_PREFIX})
-IF(DEAL_II_INSTALL_COMPAT_FILES)
+IF(DEAL_II_COMPONENT_COMPAT_FILES)
#
# The good, old directory structure:
#
ELSE()
#
- # IF DEAL_II_INSTALL_COMPAT_FILES is not set, we assume that we have to
+ # IF DEAL_II_COMPONENT_COMPAT_FILES is not set, we assume that we have to
# obey the FSHS...
#
SET_IF_EMPTY(DEAL_II_DOCUMENTATION_RELDIR "share/doc/deal.II/html")
ENDFOREACH()
+MESSAGE("
+Component configuration:")
+FOREACH(var ${res})
+ IF(var MATCHES "DEAL_II_COMPONENT")
+ IF(${${var}})
+ MESSAGE(" ${var} = ${${var}}")
+ ELSE()
+ MESSAGE(" ( ${var} = ${${var}} )")
+ ENDIF()
+ ENDIF()
+ENDFOREACH()
+
MESSAGE("
Further configuration:")
FOREACH(var ${res})
)
-IF(DEAL_II_INSTALL_PROJECT_CONFIG)
+IF(DEAL_II_COMPONENT_PROJECT_CONFIG)
#
# Configure and install the cmake project configuration:
#
ENDIF()
-IF(DEAL_II_INSTALL_COMPAT_FILES)
+IF(DEAL_II_COMPONENT_COMPAT_FILES)
#
# Configure and install the old Makefile configuration:
#
# Set up all necessary bits for the documentation
#
-IF(DEAL_II_WITH_DOXYGEN)
+IF(DEAL_II_COMPONENT_DOCUMENTATION)
#
# Generate the documentation via doxygen:
COMPONENT documentation
)
-ENDIF(DEAL_II_WITH_DOXYGEN)
+ENDIF(DEAL_II_COMPONENT_DOCUMENTATION)
-IF(DEAL_II_INSTALL_EXAMPLES)
+IF(DEAL_II_COMPONENT_EXAMPLES)
#
# Add a rule on how to install the examples:
#
ADD_EXECUTABLE(expand_instantiations expand_instantiations.cc)
-IF(DEAL_II_INSTALL_COMPAT_FILES)
+IF(DEAL_II_COMPONENT_COMPAT_FILES)
#
# Build and install the old dependency_resolution and report_features
LINK_FLAGS "${deal_ii_required_linker_flags}"
)
-TARGET_LINK_LIBRARIES(deal_II ${deal_ii_external_libraries})
+TARGET_LINK_LIBRARIES(deal_II ${DEAL_II_EXTERNAL_LIBRARIES})
#