From: maier Date: Thu, 14 Mar 2013 17:28:32 +0000 (+0000) Subject: CMake: Write the second part of the documentation X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc3b30b1fec64c0ed3d4b28b7e55064e5ecd79aa;p=dealii-svn.git CMake: Write the second part of the documentation git-svn-id: https://svn.dealii.org/trunk@28904 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/checks/check_01_system_features.cmake b/deal.II/cmake/checks/check_01_system_features.cmake index a942bf4820..f5ac8662e7 100644 --- a/deal.II/cmake/checks/check_01_system_features.cmake +++ b/deal.II/cmake/checks/check_01_system_features.cmake @@ -69,6 +69,22 @@ IF(NOT m_lib MATCHES "-NOTFOUND") ENDIF() +########################################################################### +# # +# Mac OSX specific setup: # +# # +########################################################################### + +IF(CMAKE_SYSTEM_NAME MATCHES "Darwin") + # + # Use -Wno-long-double on Apple Darwin to avoid some unnecessary + # warnings. However, newer gccs on that platform do not have + # this flag any more, so check whether we can indeed do this + # + ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-long-double") +ENDIF() + + ########################################################################### # # # Windows and CYGWIN specific setup: # diff --git a/deal.II/cmake/setup_compiler_flags_gnu.cmake b/deal.II/cmake/setup_compiler_flags_gnu.cmake index 23c3cd396d..5604f0ac49 100644 --- a/deal.II/cmake/setup_compiler_flags_gnu.cmake +++ b/deal.II/cmake/setup_compiler_flags_gnu.cmake @@ -103,16 +103,6 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") ENDIF() -IF(CMAKE_SYSTEM_NAME MATCHES "Darwin") - # - # Use -Wno-long-long on Apple Darwin to avoid some unnecessary - # warnings. However, newer gccs on that platform do not have - # this flag any more, so check whether we can indeed do this - # - ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-long-double") -ENDIF() - - ############################# # # # For Release target: # diff --git a/deal.II/doc/development/cmake-internals.html b/deal.II/doc/development/cmake-internals.html index cfb2cdb2a5..04644b250a 100644 --- a/deal.II/doc/development/cmake-internals.html +++ b/deal.II/doc/development/cmake-internals.html @@ -2,10 +2,10 @@ "http://www.w3.org/TR/html4/loose.dtd"> - The deal.II Readme + Build system internals - + @@ -14,10 +14,12 @@ -

Details on the deal.II CMake build system

+

Build system internals

- This page provides details about deal.II CMake build system. + This page provides details about the CMake build system. Files + processed by the top level CMakeLists.txt script are + listed in the TOC in cronological order.

@@ -26,12 +28,23 @@

+
Configuration: + + +
Target definition and installation + @@ -39,6 +52,7 @@

Coding convention

+

Coding conventions are always a matter of choice. Nevertheless, the following rules should be considered:

+

@@ -304,15 +319,158 @@ - -

./include/deal.II/base/config.h.in<

+ +

./cmake/modules/Find*.cmake

+ +

+ These are find modules for the configure_*.cmake files + and the CONFIGURE_FEATURE macro as will explained later. + It is crucial that a find module behaves correctly. Therefore, the + following rules are mandatory:

+ + + + +

./cmake/configure/configure_*.cmake

+ +

+ The final step in the configuration phase is the setup of features + (which refer to external or bundled libraries + deal.II can optionally interface with.) + +

+ +

+ At bare minimum configure_<feature>.cmake + file for a feature just consists of a call to the + CONFIGURE_FEATURE(<FEATURE>) macro which is + implemented in + ./cmake/macros/macro_configure_feature.cmake. + In this case the corresponding Find<FEATURE>.cmake + module is used to determine whether an external dependency can be + resolved or not. Depending on the current state of + DEAL_II_WITH_<FEATURE> (see + here) the variables +

+
+    FEATURE_LIBRARIES
+    FEATURE_INCLUDE_DIRS
+    FEATURE_LINKER_FLAGS
+          
+ are appended to the set of global variables + and DEAL_II_WITH_<FEATURE> is set to + TRUE. +

+ +

+ It is possible to override this default behaviour with the following + variables and macros (all of them are optional and will be replaced + by an appropriate default action if unset): +

+

+ + @@ -400,77 +558,37 @@

- -

Writing platform checks

- - -

Writing feature tests

+ +

./include/deal.II/base/config.h.in

-

- TODO: This section is a bit outdated, update it! -

-

- For a feature <feature> the following - the following toggles, variables and macros can be defined - defined (Note: <FEATURE> means all caps, - <feature> means all lowercase): + In contrast to autoconf there is no intermediate step any more that + automatically generates config.h.in. The setup in this file has to be + done by hand. Please note:

-
  • - A file - cmake/configure/configure_<feature>.cmake - defining how to configure <feature>: -
    -    FEATURE_${feature}_DEPENDS    (a variable)
    -      - a variable which contains an optional list of other features
    -        this feature depends on (and which have to be enbled for this feature
    -        to work.) The features must be given with the full option toggle:
    -        DEAL_II_WITH_[...]
    -
    -    FEATURE_<FEATURE>_FIND_EXTERNAL(var)  (a macro)
    -      - which should set var to TRUE if all dependencies for the feature are
    -        fulfilled. In this case all necessary variables for
    -        FEATURE_<FEATURE>_CONFIGURE_EXTERNAL must be set. Otherwise
    -        var should remain unset.
    -        If not defined, FIND_PACKAGE(${feature}) is called.
    -
    -    FEATURE_<FEATURE>_CONFIGURE_EXTERNAL()  (a macro)
    -      - which should setup all necessary configuration for the feature with
    -        external dependencies. If something goes wrong this macro must
    -        issue a FATAL_ERROR.
     
    -    FEATURE_<FEATURE>_CONFIGURE_BUNDLED()  (a macro)
    -      - which should setup all necessary configuration for the feature with
    -        bundled source dependencies. If something goes wrong this macro must
    -        issue a FATAL_ERROR.
    +    
    +    

    ./source/CMakeLists.txt

    - FEATURE_<FEATURE>_ERROR_MESSAGE() (macro, optional) - - which should print a meaningful error message (with FATAL_ERROR) for - the case that no external library was found (and bundled is not - allowed to be used.) If not defined, a suitable default error message - will be printed. -
    - -
  • - In bundled/CMakeLists.txt: -
    +    

    + TODO +

    - DEAL_II_FORCE_BUNDLED_<FEATURE> (a boolean) - - If <feature> can be set up by bundled libraries, this - configuration option must be present to force use of bundled - dependencies + +

    ./cmake/config/CMakeLists.txt

    - FEATURE_<FEATURE>_HAVE_BUNDLED (a variable) - - which should either be set to TRUE if all necessary libraries of the - features comes bundled with deal.II and hence can be supported - without external dependencies, or unset. -
    - - Setup of compilation and installation if - FEATURE_<FEATURE>_BUNDLED_CONFIGURED is set. - +

    + TODO

    +
    diff --git a/deal.II/doc/development/toc.html b/deal.II/doc/development/toc.html index cca55047b0..3657347d08 100644 --- a/deal.II/doc/development/toc.html +++ b/deal.II/doc/development/toc.html @@ -50,7 +50,7 @@

  • - deal.II CMake internals: + Build system internals: This page provides implementation and development details about the CMake build system.