From c22095b64b7ec0b56a370761afffd8eb49db0698 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 22 Apr 2016 09:48:16 +0200 Subject: [PATCH] extend documentation to show how to use only native CMake commands --- doc/users/cmakelists.html | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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

    -- 2.39.5