diff options
author | Joseph Snyder <joe.snyder@kitware.com> | 2021-09-24 12:59:23 (GMT) |
---|---|---|
committer | Joseph Snyder <joe.snyder@kitware.com> | 2021-09-24 12:59:23 (GMT) |
commit | 68e0f72744320e9ffb3ae3c39b648386dc0296ad (patch) | |
tree | 563ff3957fd1b3aee1bdd069ee694ad45b678880 /Help/guide | |
parent | efed2f8706b46d2f5c7711a9426b7e23a08b9709 (diff) | |
download | CMake-68e0f72744320e9ffb3ae3c39b648386dc0296ad.zip CMake-68e0f72744320e9ffb3ae3c39b648386dc0296ad.tar.gz CMake-68e0f72744320e9ffb3ae3c39b648386dc0296ad.tar.bz2 |
Tutorial: Describe placement of add_subdirectory
Clarify that the process of making a target optional in the second step
of the tutorial is further steps to the work done before, not
a separate addition to the file.
Do this by ensuring that the paragraph which describes the work done
mentions the placement and use of the previous command.
This is done to avoid duplication of the add_subdirectory call.
CMake Issue: #22663
Diffstat (limited to 'Help/guide')
-rw-r--r-- | Help/guide/tutorial/Adding a Library.rst | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Help/guide/tutorial/Adding a Library.rst b/Help/guide/tutorial/Adding a Library.rst index 1806361..ed03448 100644 --- a/Help/guide/tutorial/Adding a Library.rst +++ b/Help/guide/tutorial/Adding a Library.rst @@ -64,8 +64,13 @@ will be stored in the cache so that the user does not need to set the value each time they run CMake on a build directory. The next change is to make building and linking the ``MathFunctions`` library -conditional. To do this we change the end of the top-level ``CMakeLists.txt`` -file to look like the following: +conditional. To do this, we will create an ``if`` statement which checks the +value of the option. Inside the ``if`` block, put the +:command:`add_subdirectory` command from above with some additional list +commands to store information needed to link to the library and add the +subdirectory as an include directory in the ``Tutorial`` target. +The end of the top-level ``CMakeLists.txt`` file will now look like the +following: .. literalinclude:: Step3/CMakeLists.txt :caption: CMakeLists.txt |