From: Denis Davydov Date: Fri, 22 Apr 2016 07:48:16 +0000 (+0200) Subject: extend documentation to show how to use only native CMake commands X-Git-Tag: v8.5.0-rc1~1074^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2542%2Fhead;p=dealii.git extend documentation to show how to use only native CMake commands --- diff --git a/doc/users/cmakelists.html b/doc/users/cmakelists.html index ecc73de2a8..730da4db1c 100644 --- a/doc/users/cmakelists.html +++ b/doc/users/cmakelists.html @@ -39,6 +39,7 @@
  • File globs
  • DEAL_II_SETUP_TARGET revisited
  • DEAL_II_INITIALIZE_CACHED_VARIABLES revisited
  • +
  • Use only native CMake commands
  • Customizing include directories and compile definitions
  • External libraries
  • The "run" target revisited
  • @@ -529,6 +530,30 @@ href="#cmakeadvanced.setup_target">DEAL_II_SETUP_TARGET for further details.

    + +

    Use only native CMake commands

    + +

    +In order to have the ultimate flexibility, it is also possible to configure a +user project using only native CMake commands, that is avoid usage of +DEAL_II_INITIALIZE_CACHED_VARIABLES and DEAL_II_SETUP_TARGET macros. +This can be achieved, for example, by the following code +

    +CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
    +# Find and include deal.IIConfig.cmake
    +FIND_PACKAGE(deal.II 8.5.0 REQUIRED
    +  HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
    +  )
    +PROJECT(example)
    +
    +# Include deal.IITargets.cmake
    +INCLUDE(${DEAL_II_TARGET_CONFIG})
    +
    +ADD_EXECUTABLE(example example.src)
    +TARGET_LINK_LIBRARIES(example ${DEAL_II_TARGET})
    +
    +

    +

    Customizing include directories and compile definitions