From 949d8cce8c511d98136b55d1129830216712f7ba Mon Sep 17 00:00:00 2001 From: Sebastian Eibl <sebastian.eibl@mpcdf.mpg.de> Date: Wed, 6 Jul 2022 10:59:18 +0200 Subject: [PATCH] further clarifications --- 00_targets/README.md | 16 +++++++++++----- 02_mkl/README.md | 10 +++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/00_targets/README.md b/00_targets/README.md index d2a2992..63ca5b5 100644 --- a/00_targets/README.md +++ b/00_targets/README.md @@ -3,6 +3,12 @@ This recipe illustrates how to build a basic application. It consists of a backend library and an application frontend. +## What is a target? +Targets provide modularization and encapsulation. A target +encapsulates everything needed for a certain build job. It also +is some kind of container that allows efficient use as a building +block. + ## Define the target type [add_library](https://cmake.org/cmake/help/latest/command/add_library.html) [add_executable](https://cmake.org/cmake/help/latest/command/add_executable.html) @@ -20,11 +26,11 @@ It consists of a backend library and an application frontend. ## Usage requirements https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#transitive-usage-requirements -| keyword | result | -|---------------|------------------------------------------------------------| -| **PRIVATE** | only relevant for the target | -| **INTERFACE** | only relevant for targets depending on this target | -| **PUBLIC** | relevant for both, the target itself and dependent targets | +| keyword | result | +|---------------|--------------------------------------------------------------| +| **PRIVATE** | required to build the target, but not required when using it | +| **INTERFACE** | not required to build the target, but required when using it | +| **PUBLIC** | required for for building the target and for using it | ## How to link against a "supported" third-party library? Find the library with [find_package](https://cmake.org/cmake/help/latest/command/find_package.html) and link against diff --git a/02_mkl/README.md b/02_mkl/README.md index d95aa73..7f41cd0 100644 --- a/02_mkl/README.md +++ b/02_mkl/README.md @@ -1,9 +1,9 @@ # Advantages of using targets -Targets provide modularization and encapsulation. A target -encapsulates everything needed for a certain build job. In the best -case the user of a target does not have to worry about anything, since -the developer of the target already put all information into it. +A developer providing the necessary files to use the library in CMake +is a very good example to show the strength of targets. In the best +case the end-user of the library does not have to worry about anything, +since the developer has put all necessary information into the target. For this example to work you need a recent oneAPI installation and -you need to set `MKL_ROOT`. \ No newline at end of file +you need to set `MKL_ROOT` to the MKL directory. \ No newline at end of file -- GitLab