From 88445798c562b62eb4ff9a7ac8eaebd16d0d55b4 Mon Sep 17 00:00:00 2001 From: maier Date: Thu, 14 Mar 2013 13:15:07 +0000 Subject: [PATCH] Reorganize the documentation git-svn-id: https://svn.dealii.org/trunk@28902 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/development/cmake.html | 238 +---------------------- deal.II/doc/development/cmakelists.html | 243 +++++++++++++++++++++++- deal.II/doc/development/toc.html | 21 +- 3 files changed, 249 insertions(+), 253 deletions(-) diff --git a/deal.II/doc/development/cmake.html b/deal.II/doc/development/cmake.html index f2a9816d78..86096cb278 100644 --- a/deal.II/doc/development/cmake.html +++ b/deal.II/doc/development/cmake.html @@ -2,7 +2,7 @@ "http://www.w3.org/TR/html4/loose.dtd"> - The deal.II Readme + deal.II CMake documentation @@ -45,12 +45,6 @@
  • Selecting a compiler
  • Installation -
  • How to use deal.II in your CMake project -
  • Initial cache file and advanced options
  • Compiling only certain parts @@ -638,236 +632,6 @@

    - -

    How to use deal.II in your CMake project

    - -

    - Using deal.II in your own project is particularly - simple if your project also uses cmake. The following - subsections describe this process. -

    - - - -

    Finding the deal.II library

    - -

    - Finding the deal.II library should be no more than -

    -
    -    FIND_PACKAGE(deal.II REQUIRED)
    -      
    - in your CMakeLists.txt file. You may have to hint for the location - of the deal.IIConfig.cmake file. Either by directly - specifying deal.II_DIR to point to the path were the - deal.IIConfig.cmake file is located: -
    -
    -    cmake -Ddeal.II_DIR=/path/to/the/config/file <...>
    -      
    - or by specifying a search path via CMAKE_PREFIX_PATH, - e.g. -
    -
    -    cmake -DCMAKE_PREFIX_PATH=~/workspace/local
    -      
    - In this case deal.IIConfig.cmake will be searched - for in -
    -
    -    ~/workspace/local/
    -    ~/workspace/local/lib/cmake/deal.II/
    -      
    -

    - - - -

    deal.IIConfig.cmake

    - -

    - Importing the deal.IIConfig.cmake file via FIND_PACKAGE - will set a bunch of variables and macros; all of the form - DEAL_II_*. There is the usual duplet: -

    -
    -    DEAL_II_INCLUDE_DIRS
    -    DEAL_II_LIBRARIES
    -      
    - (with debug and optimized keywords. For - compatibility there is also DEAL_II_LIBRARIES_DEBUG - and DEAL_II_LIBRARIES_RELEASE only specifying the - respective set of libraries.) -

    - -

    - Interesting additional variables might be: -

    -
    -    DEAL_II_USER_DEFINITIONS
    -    DEAL_II_USER_DEFINITIONS_DEBUG
    -    DEAL_II_USER_DEFINITIONS_RELEASE
    -    DEAL_II_LINKER_FLAGS
    -    DEAL_II_LINKER_FLAGS_DEBUG
    -    DEAL_II_LINKER_FLAGS_RELEASE
    -    DEAL_II_CXX_FLAGS
    -    DEAL_II_CXX_FLAGS_DEBUG
    -    DEAL_II_CXX_FLAGS_RELEASE
    -
    -    DEAL_II_TARGET_CONFIG
    -    DEAL_II_TARGET
    -    DEAL_II_TARGET_DEBUG
    -    DEAL_II_TARGET_RELEASE
    -      
    -

    - - - - -

    Setting up necessary configuration variables

    - -

    - For actually using deal.II in your CMake - project some configuration steps are necessary. These can be - either set via macros or by hand: -

      -
    1. Configuration with the help of - two convencience macros: -

      - deal.IIConfig.cmake includes some convenience macros - to automatically setup all necessary configuration. A fully - functional, minimal example for the step-1 tutorial program is: -

      -
      -    FIND_PACKAGE(deal.II REQUIRED)
      -
      -    DEAL_II_INITIALIZE_CACHED_VARIABLES()
      -
      -    PROJECT(step-1)
      -
      -    ADD_EXECUTABLE(step-1 step-1.cc)
      -    DEAL_II_SETUP_TARGET(step-1)
      -	  
      -

      - - -
    2. Configuration by hand: -
        -
      • Set up all include directories for header files: -
        -
        -    INCLUDE_DIRECTORIES(${DEAL_II_INCLUDE_DIRS})
        -	      
        - -
      • - deal.II usually ships with an optimized Release and a Debug version - of the library. So it is a good idea to set up - CMAKE_BUILD_TYPE accordingly: -
        -
        -    SET(CMAKE_BUILD_TYPE "Debug" CACHE
        -      "Choose the type of build, options are: Debug, Release"
        -      )
        -	      
        - - A cached variable ensures that we can later switch the build type - by editing the cache: -
        -
        -    make edit_cache
        -	      
        - -
      • Often, it is a good idea to use the same compiler and linker - flags as the deal.II library. -
        -
        -    SET(CMAKE_CXX_FLAGS ${DEAL_II_CXX_FLAGS})
        -    SET(CMAKE_CXX_FLAGS_RELEASE ${DEAL_II_CXX_FLAGS_RELEASE})
        -    SET(CMAKE_CXX_FLAGS_DEBUG ${DEAL_II_CXX_FLAGS_DEBUG})
        -	      
        - (Optionally you can set up the variables with the - CACHE to be able to edit them via ccmake or - make edit_cache.) - -
      • - After this, specify your project name: -
        -
        -    PROJECT(myProject)
        -	      
        - This ensures that the compiler detection and platform setup - that is issued by calling PROJECT(...) will run - after we have set up our cached variables. This way it is - our choice of variables that will be set and not the default - values determined by the PROJECT(...) call. - -
      • - After defining your targets, e.g. -
        -
        -    ADD_EXECUTABLE(step-1 step-1.cc)
        -	      
        - you have to specify to link against deal.II and all external - libraries: -
        -
        -    TARGET_LINK_LIBRARIES(step-1 ${DEAL_II_LIBRARIES})
        -	      
        - -
      • as well as using some preprocessor definitions: -
        -
        -    SET_TARGET_PROPERTIES(step-1 PROPERTIES
        -      COMPILE_DEFINITIONS
        -      "${DEAL_II_USER_DEFINITIONS}"
        -      COMPILE_DEFINITIONS_DEBUG
        -      "${DEAL_II_USER_DEFINITIONS_DEBUG}"
        -      COMPILE_DEFINITIONS_RELEASE
        -      "${DEAL_II_USER_DEFINITIONS_RELEASE}"
        -      )
        -	      
        - -
      • Optionally, you can set the link flags to the one used by the - deal.II library: -
        -
        -    SET_TARGET_PROPERTIES(step-1 PROPERTIES
        -      LINK_FLAGS
        -      "${DEAL_II_LINKER_FLAGS}"
        -      LINK_FLAGS_DEBUG
        -      "${DEAL_II_LINKER_FLAGS_DEBUG}"
        -      LINK_FLAGS_RELEASE
        -      "${DEAL_II_LINKER_FLAGS_RELEASE}"
        -      )
        -	      
        - And this it is. - -
      - -
    3. - Advanced setup: - -

      - For an advanced setup in a big CMake project - deal.IIConfig.cmake - provides information about the deal.II - installation with traditional variables, see - here, as well as external CMake - targets with link interface for direct inclusion: -

      -
      -    INCLUDE(${DEAL_II_TARGET_CONFIG})
      -
      -    ADD_EXECUTABLE(step-1
      -      step-1.cc
      -      ${DEAL_II_TARGET}
      -      )
      -              
      -

      -
    -

    - -

    Initial cache file and advanced options

    diff --git a/deal.II/doc/development/cmakelists.html b/deal.II/doc/development/cmakelists.html index 7c9061735a..163702a755 100644 --- a/deal.II/doc/development/cmakelists.html +++ b/deal.II/doc/development/cmakelists.html @@ -2,7 +2,7 @@ "http://www.w3.org/TR/html4/loose.dtd"> - Information on using CMake for deal.II projects + How to interface with deal.II in your own project @@ -21,11 +21,16 @@ Table of contents