From b252b0df61bc4d672f1e640af52d656ccbd06368 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 6 Jul 2023 14:13:14 -0500 Subject: [PATCH] write second CMake paragraph --- 9.5/paper.tex | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/9.5/paper.tex b/9.5/paper.tex index c3ae36c..30ae240 100644 --- a/9.5/paper.tex +++ b/9.5/paper.tex @@ -904,7 +904,29 @@ The next release of \dealii{} will build upon C++17. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Build-system modernization}\label{sec:buildsystem} -\todo[inline]{Matthias: Write?} +\dealii's CMake project configuration itself now exports three targets, +\texttt{dealii::dealii\_debug}, \texttt{dealii::dealii\_release}, and +\texttt{dealii::dealii}. Linking against one of the first two variants via +\texttt{target\_link\_libraries()} populates the target with all necessary +include directories and the full link interface necessary for \dealii. The +third variant, \texttt{dealii::dealii}, automatically switches between +debug and release interface depending on the build type set via +\texttt{CMAKE\_BUILD\_TYPE}. The \texttt{dealii::dealii} third variant also +populates compiler and linker options, whereas for the first two variants a +client project has to ensure that the compiler and linker are properly set +up. The new import targets make it now possible to configure a dependent +project without the use of any \dealii specific macros: +% +\begin{anycode} +cmake_minimum_required(VERSION 3.13.4) +set(CMAKE_BUILD_TYPE Debug CACHE STRING "") +project(step CXX) + +find_package(deal.II 9.5.0 REQUIRED) + +add_executable(step step.cc) +target_link_libraries(step dealii::dealii) +\end{anycode} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- 2.39.5