]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Last, big overhaul
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 21 Sep 2012 18:29:31 +0000 (18:29 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 21 Sep 2012 18:29:31 +0000 (18:29 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26604 0785d39b-7218-0410-832d-ea1e28bc413d

16 files changed:
deal.II/CMakeLists.txt
deal.II/README [deleted file]
deal.II/README_CMAKE [new file with mode: 0644]
deal.II/TODO_CMAKE [moved from deal.II/cmake-TODO with 100% similarity]
deal.II/cmake/bugs.m4 [moved from deal.II/bugs.m4 with 100% similarity]
deal.II/cmake/compiler.m4 [moved from deal.II/compiler.m4 with 100% similarity]
deal.II/cmake/features.m4 [moved from deal.II/features.m4 with 100% similarity]
deal.II/cmake/setup_cached_variables.cmake
deal.II/cmake/setup_custom_targets.cmake
deal.II/cmake/setup_deal_ii.cmake
deal.II/cmake/setup_finalize.cmake
deal.II/config/CMakeLists.txt
deal.II/doc/CMakeLists.txt
deal.II/examples/CMakeLists.txt
deal.II/scripts/CMakeLists.txt
deal.II/source/CMakeLists.txt

index 020b2550f29859eeeca5640a0180dd61b0a857c2..8257127f1e791d104abf98a2beacd2c795a7b45d 100644 (file)
+
+
+###########################################################################
+##                                                                       ##
+##  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
-#
 
 
 
@@ -220,21 +135,31 @@ OPTION(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
   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)
 
 
diff --git a/deal.II/README b/deal.II/README
deleted file mode 100644 (file)
index 28208fe..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-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
diff --git a/deal.II/README_CMAKE b/deal.II/README_CMAKE
new file mode 100644 (file)
index 0000000..6f80c3a
--- /dev/null
@@ -0,0 +1,248 @@
+
+
+
+            ==============================================
+
+            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
+
+
+
+
similarity index 100%
rename from deal.II/cmake-TODO
rename to deal.II/TODO_CMAKE
similarity index 100%
rename from deal.II/bugs.m4
rename to deal.II/cmake/bugs.m4
index c2162d66e1c869f88e4e829c099737882375e922..cf89d177c514f01a72d6c8aea887b56c946c1c23 100644 (file)
@@ -56,7 +56,17 @@ ENDIF()
 #
 # 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
+  ")
 
 
 #
index 30fcba93e446ce292b8f14c10422319f24dfae6f..8c48e19911df2a0cf596694357d06686ae729d58 100644 (file)
@@ -13,7 +13,7 @@ ADD_CUSTOM_TARGET(library)
 ADD_DEPENDENCIES(library deal_II)
 
 
-IF(DEAL_II_WITH_DOXYGEN)
+IF(DEAL_II_COMPONENT_DOCUMENTATION)
 
   ADD_CUSTOM_TARGET(documentation)
   ADD_DEPENDENCIES(documentation doxygen)
@@ -21,14 +21,19 @@ IF(DEAL_II_WITH_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)
 
index 800d1a9707c924643181f79bbf617033eda73125..b7d58be5844b42aae83d0c4bbf0694ce1e665663 100644 (file)
@@ -19,7 +19,7 @@ STRING(REGEX REPLACE
 
 SET(DEAL_II_PATH ${CMAKE_INSTALL_PREFIX})
 
-IF(DEAL_II_INSTALL_COMPAT_FILES)
+IF(DEAL_II_COMPONENT_COMPAT_FILES)
   #
   # The good, old directory structure:
   #
@@ -31,7 +31,7 @@ IF(DEAL_II_INSTALL_COMPAT_FILES)
 
 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")
index b0bbade036ce5ed223b67fa49c704890da6cdf31..8b24ab45c24ccdd8e95c584f396342c03362dcd7 100644 (file)
@@ -87,6 +87,18 @@ FOREACH(var ${res})
 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})
index facfe9181ac7a49581e953aaf53a27a720f0706f..1c77d389ec252cdb3e216cfb6a7cc40cd43465ba 100644 (file)
@@ -4,7 +4,7 @@ CONFIGURE_FILE(
   )
 
 
-IF(DEAL_II_INSTALL_PROJECT_CONFIG)
+IF(DEAL_II_COMPONENT_PROJECT_CONFIG)
   #
   # Configure and install the cmake project configuration:
   #
@@ -38,7 +38,7 @@ IF(DEAL_II_INSTALL_PROJECT_CONFIG)
 ENDIF()
 
 
-IF(DEAL_II_INSTALL_COMPAT_FILES)
+IF(DEAL_II_COMPONENT_COMPAT_FILES)
   #
   # Configure and install the old Makefile configuration:
   #
index 65681fdabfaa98c82676ad64ff29debcbba46bcc..7a5c6309162ec46e4653752f1a06854b3bcf5cba 100644 (file)
@@ -3,7 +3,7 @@
 # Set up all necessary bits for the documentation
 #
 
-IF(DEAL_II_WITH_DOXYGEN)
+IF(DEAL_II_COMPONENT_DOCUMENTATION)
 
   #
   # Generate the documentation via doxygen:
@@ -31,5 +31,5 @@ IF(DEAL_II_WITH_DOXYGEN)
     COMPONENT documentation
     )
 
-ENDIF(DEAL_II_WITH_DOXYGEN)
+ENDIF(DEAL_II_COMPONENT_DOCUMENTATION)
 
index 1b5df3649589a7e5c00a57a0deab2b5491e6378a..80fcfd8a3a276487e5b6269309bdf319d7272765 100644 (file)
@@ -1,5 +1,5 @@
 
-IF(DEAL_II_INSTALL_EXAMPLES)
+IF(DEAL_II_COMPONENT_EXAMPLES)
   #
   # Add a rule on how to install the examples:
   #
index 5bfbeca96e6df677e6c4f544df3549ee091738d6..4e0ede74f9f8b74ede1593f084613561c2da526f 100644 (file)
@@ -2,7 +2,7 @@
 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
index 90a8ebc274241d46bd34317d480d2f04c27a65ca..3c0628e489b40d418bf69416765bd87d166e0062 100644 (file)
@@ -53,7 +53,7 @@ SET_TARGET_PROPERTIES(deal_II PROPERTIES
   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})
 
 
 #

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.