--- /dev/null
+## ##
+# A simple CMakeLists.txt file for use with deal.II #
+## ##
+
+#
+# Set the name of the project and target:
+#
+SET(TARGET "step-1")
+
+#
+# Declare all source files the target consists of:
+#
+SET(TARGET_SRC
+ ${TARGET}.cc
+ # You can specify additional files here!
+ )
+
+#
+# (Optional)
+# Specify a list of files (file globs) that will be removed
+# with the "make runclean" and "make distclean" targets.
+# If empty, sensible default values will be used.
+#
+SET(CLEAN_UP_FILES
+ # a custom list of globs, e.g. *.log *.vtk
+ )
+
+#
+# (Optional)
+# A custom command line that should be invoked by "make run". If empty,
+# ${TARGET} will be invoked.
+#
+SET(TARGET_RUN
+ # a custom command line, e.g. mpirun -np 2 ${TARGET}
+ )
+
+#
+# It is good practise to specify a version requirement:
+#
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
+
+#
+# Find and import the deal.II project configuration:
+#
+FIND_PACKAGE(deal.II 8.0 REQUIRED
+ HINTS
+ ${DEAL_II_DIRS} ../ ../../ ../../../ ../../../../../ $ENV{DEAL_II_DIR}
+ #
+ # If the deal.II library cannot be found (because it is not installed at a
+ # default location or your project resides at an uncommon place), you
+ # can specify additional hints for search paths here, e.g.
+ # "$ENV{HOME}/workspace/deal.II"
+ #
+ )
+
+#
+# And let deal.II do the rest:
+#
+DEAL_II_INITIALIZE_CACHED_VARIABLES()
+PROJECT(${TARGET})
+DEAL_II_INVOKE_AUTOPILOT()
+
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title>The deal.II Readme</title>
+ <link href="../screen.css" rel="StyleSheet">
+ <meta name="author" content="the deal.II authors <authors @ dealii.org>">
+ <meta name="copyright" content="Copyright (C) 2012 by the deal.II authors">
+ <meta name="date" content="$Date$">
+ <meta name="svn_id" content="$Id$">
+ <meta name="keywords" content="deal.II">
+ </head>
+
+ <body>
+
+ <h1>How to interface with <acronym>deal.II</acronym> in your own
+ project</h1>
+
+ <p>
+ <table class="tutorial" width="50%">
+ <tr><th colspan="2"><b><small>Table of contents</small></b></th></tr>
+ <tr><td valign="top">
+ <ul>
+ <li><a href="#cmake">Using <acronym>deal.II</acronym> in a
+ CMake project</a>
+ <ul>
+ <li><a href="#cmakesimple">Simple CMakeLists.txt</a>
+ <li><a href="#cmakeadvanced">Advanced CMakeLists.txt</a>
+ </ul>
+ <li><a href="#legacy">Legacy
+ <code>Make.global_options</code></a>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </p>
+
+
+ <a name="cmake"></a>
+ <h3> Using <acronym>deal.II</acronym> in a CMake project </h3>
+
+ <p>
+ This section presents some <code>CMakeLists.txt</code> examples for
+ potential use in your projects. A detailed description of the
+ <acronym>deal.II</acronym> project configuration is given in the
+ <a href="cmake.html#ext" target="body">deal.II CMake ReadME</a>.
+ </p>
+
+ <a name="cmakesimple"></a>
+ <h4>Simple CMakeLists.txt</h4>
+
+ <p>
+ The easiest way to write a <code>CMakeLists.txt</code> file is to use
+ an "autopilot" style macro which mimics the old user
+ <code>Makefile</code> behaviour. Here is an example for the step-1
+ tutorial program: (<a href="CMakeLists.txt.example" target="_top">raw</a> version.)
+ <pre>
+
+ #
+ # Set the name of the project and target:
+ #
+ SET(TARGET "step-1")
+
+ #
+ # Declare all source files the target consists of:
+ #
+ SET(TARGET_SRC
+ ${TARGET}.cc
+ # You can specify additional files here!
+ )
+
+ #
+ # (Optional)
+ # Specify a list of files (file globs) that will be removed
+ # with the "make runclean" and "make distclean" targets.
+ # If empty, sensible default values will be used.
+ #
+ SET(CLEAN_UP_FILES
+ # a custom list of globs, e.g. *.log *.vtk
+ )
+
+ #
+ # (Optional)
+ # A custom command line that should be invoked by "make run". If empty,
+ # ${TARGET} will be invoked.
+ #
+ SET(TARGET_RUN
+ # a custom command line, e.g. mpirun -np 2 ${TARGET}
+ )
+
+ #
+ # It is good practise to specify a version requirement:
+ #
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
+
+ #
+ # Find and import the deal.II project configuration:
+ #
+ FIND_PACKAGE(deal.II 8.0 REQUIRED
+ HINTS
+ ${DEAL_II_DIRS} ../ ../../ ../../../ ../../../../../ $ENV{DEAL_II_DIR}
+ #
+ # If the deal.II library cannot be found (because it is not installed at a
+ # default location or your project resides at an uncommon place), you
+ # can specify additional hints for search paths here, e.g.
+ # "$ENV{HOME}/workspace/deal.II"
+ #
+ )
+
+ #
+ # And let deal.II do the rest:
+ #
+ DEAL_II_INITIALIZE_CACHED_VARIABLES()
+ PROJECT(${TARGET})
+ DEAL_II_INVOKE_AUTOPILOT()
+ </pre>
+
+ This <code>CMakeLists.txt</code> is intended for use with a small
+ project and <i>in-source</i> build:
+ <pre>
+
+ $ cd step-1
+ $ cmake .
+
+ [...]
+
+ ###
+ #
+ # Successfully set up project step-1 with deal.II-8.0.pre found at
+ # /usr/local
+ #
+ # CMAKE_BUILD_TYPE: Debug
+ # TARGET_SRC: step-1.cc
+ #
+ # You can now run
+ # $ make - to compile and link the program
+ # $ make run - to (compile, link and) run the program
+ #
+ # $ make debug - to switch the build type to "Debug"
+ # $ make release - to switch the build type to "Release"
+ # $ make edit_cache - to change (cached) configuration variables
+ # and rerun the configure and generate phases of CMake
+ #
+ # $ make clean - to remove the generated executable as well as
+ # all intermediate compilation files
+ # $ make runclean - to remove all output generated by the program
+ # $ make distclean - to clean the directory from _all_ generated
+ # files (includes clean, runclean and the removal
+ # of the generated build system)
+ #
+ # Have a nice day!
+ #
+ ###
+ </pre>
+ </p>
+
+ <a name="cmakeadvanced"></a>
+ <h4>Advanced CMakeLists.txt</h4>
+
+ <p>
+ For large projects the simple <code>CMakeLists.txt</code> presented
+ above tends to be too inflexible.
+ So, if you wish to have more control about targets the
+ <code>DEAL_II_SETUP_TARGET</code> macro might be of interest for you.
+ Here is a full example for the step-1 tutorial program:
+ <pre>
+
+ #
+ # It is good practise to specify a version requirement:
+ #
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
+
+ #
+ # Find and import the deal.II project configuration:
+ #
+ FIND_PACKAGE(deal.II 8.0 REQUIRED
+ HINTS
+ ${DEAL_II_DIRS} ../ ../../ ../../../ ../../../../../ $ENV{DEAL_II_DIR}
+ #
+ # If the deal.II library cannot be found (because it is not installed at a
+ # default location or your project resides at an uncommon place), you
+ # can specify additional hints for search paths here, e.g.
+ # "$ENV{HOME}/workspace/deal.II"
+ #
+ )
+
+ #
+ # Initialize cached variables: This will set the compiler and
+ # compiler flags to the values deal.II was configured with, as well as,
+ # CMAKE_BUILD_TYPE to "Debug".
+ # These values can be altered by editing the cache via
+ # $ make edit_cache
+ #
+ DEAL_II_INITIALIZE_CACHED_VARIABLES()
+
+ #
+ # PROJECT has to be called after DEAL_II_INITIALIZE_CACHED_VARIABLES
+ # otherwise CMake will have already set the compiler and compiler
+ # flags.
+ #
+ PROJECT(step-1)
+
+ #
+ # Specify a target:
+ #
+ ADD_EXECUTABLE(step-1 step-1.cc)
+
+ #
+ # DEAL_II_SETUP_TARGET will set up all necessary include paths,
+ # preprocessor definitions and the link interface:
+ #
+ DEAL_II_SETUP_TARGET(step-1)
+
+ #
+ # (Optional)
+ # If you wish to have a "run" target for make, specify one:
+ #
+ ADD_CUSTOM_TARGET(run
+ COMMAND step-1
+ COMMENT "Run ${TARGET} with ${CMAKE_BUILD_TYPE} configuration"
+ )
+ </pre>
+
+ Further details can be found in the <a href="cmake.html#ext"
+ target="body">deal.II CMake ReadME</a>.
+ </p>
+
+ <a name="legacy"></a>
+ <h3> Legacy Make.global_options </h3>
+
+ <p>
+ The CMake build system sets up the following compatibility files (if
+ <code>DEAL_II_COMPONENT_COMPAT_FILES</code> is set, which is default):
+ <pre>
+
+ ${CMAKE_INSTALL_PREFIX}
+ ./common/Make.global_options
+ ./common/scripts/expand_instantiations
+ ./common/scripts/make_dependencies
+ ./common/scripts/report_features
+ </pre>
+
+ Therefore, it should be sufficient to set <code>D</code> in the old
+ user Makefiles to:
+ <pre>
+
+ D=/path/install/dir
+ </pre>
+ where <code>/path/install/dir</code> is the directory set up via
+ <code>CMAKE_INSTALL_PREFIX</code> (the path
+ <acronym>deal.II</acronym> was installed to).
+ </p>
+
+
+
+ <hr>
+
+ <address>
+ <a href="mail.html" target="body">The deal.II Group</a>
+ $Date$
+ </address>
+ </body>
+</html>