]> https://gitweb.dealii.org/ - dealii.git/commitdiff
extend documentation to show how to use only native CMake commands 2542/head
authorDenis Davydov <davydden@gmail.com>
Fri, 22 Apr 2016 07:48:16 +0000 (09:48 +0200)
committerDenis Davydov <davydden@gmail.com>
Sat, 23 Apr 2016 04:57:59 +0000 (06:57 +0200)
doc/users/cmakelists.html

index ecc73de2a80432bc5c6cd971a6391374f5aaf701..730da4db1c1c0a2abde34ccd869f1e4f0e1d29d5 100644 (file)
@@ -39,6 +39,7 @@
         <li><a href="#cmakeadvanced.globs">File globs</a></li>
         <li><a href="#cmakeadvanced.setup_target"><code>DEAL_II_SETUP_TARGET</code> revisited</a></li>
         <li><a href="#cmakeadvanced.cached_variables"><code>DEAL_II_INITIALIZE_CACHED_VARIABLES</code> revisited</a></li>
+        <li><a href="#cmakeadvanced.native_cmake">Use only native CMake commands</a></li>
         <li><a href="#cmakeadvanced.properties">Customizing include directories and compile definitions</a></li>
         <li><a href="#cmakeadvanced.external_libraries">External libraries</a></li>
         <li><a href="#cmakeadvanced.run">The "run" target revisited</a></li>
@@ -529,6 +530,30 @@ href="#cmakeadvanced.setup_target"><code>DEAL_II_SETUP_TARGET</code></a>
 for further details.
 </p>
 
+<a name="cmakeadvanced.native_cmake"></a>
+<h3>Use only native CMake commands</h3>
+
+<p>
+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
+<code>DEAL_II_INITIALIZE_CACHED_VARIABLES</code> and <code>DEAL_II_SETUP_TARGET</code> macros.
+This can be achieved, for example, by the following code
+<pre class="cmake">
+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})
+</pre>
+</p>
+
 <a name="cmakeadvanced.properties"></a>
 <h3>Customizing include directories and compile definitions</h3>
 

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.