diff options
author | Josef Angstenberger <code@jtxa.de> | 2021-06-10 21:42:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-06-17 15:57:56 (GMT) |
commit | fe60154fe8efc7528da92f6b9a6b17a6f9d4a179 (patch) | |
tree | 58ee8040eb04c4e9be5017cc562c3adae0764ec4 /Help/guide/tutorial/Adding a Library.rst | |
parent | 25dde20cc5df77326f369c2dbcca3edcf687e581 (diff) | |
download | CMake-fe60154fe8efc7528da92f6b9a6b17a6f9d4a179.zip CMake-fe60154fe8efc7528da92f6b9a6b17a6f9d4a179.tar.gz CMake-fe60154fe8efc7528da92f6b9a6b17a6f9d4a179.tar.bz2 |
Tutorial: Small formatting improvements
- Use inline literals for all code fragments and names.
- Add missing console code-blocks.
- Always use c++, not c as code language.
Diffstat (limited to 'Help/guide/tutorial/Adding a Library.rst')
-rw-r--r-- | Help/guide/tutorial/Adding a Library.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Help/guide/tutorial/Adding a Library.rst b/Help/guide/tutorial/Adding a Library.rst index 3ff966c..4462aaa 100644 --- a/Help/guide/tutorial/Adding a Library.rst +++ b/Help/guide/tutorial/Adding a Library.rst @@ -41,7 +41,7 @@ last few lines of the top-level ``CMakeLists.txt`` file should now look like: "${PROJECT_SOURCE_DIR}/MathFunctions" ) -Now let us make the MathFunctions library optional. While for the tutorial +Now let us make the ``MathFunctions`` library optional. While for the tutorial there really isn't any need to do so, for larger projects this is a common occurrence. The first step is to add an option to the top-level ``CMakeLists.txt`` file. @@ -53,11 +53,11 @@ occurrence. The first step is to add an option to the top-level This option will be displayed in the :manual:`cmake-gui <cmake-gui(1)>` and :manual:`ccmake <ccmake(1)>` -with a default value of ON that can be changed by the user. This setting 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. +with a default value of ``ON`` that can be changed by the user. This setting +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 +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: @@ -92,7 +92,7 @@ Since the source code now requires ``USE_MYMATH`` we can add it to ``TutorialConfig.h.in`` with the following line: .. literalinclude:: Step3/TutorialConfig.h.in - :language: c + :language: c++ :lines: 4 **Exercise**: Why is it important that we configure ``TutorialConfig.h.in`` @@ -113,4 +113,4 @@ command-line, try: Rebuild and run the tutorial again. -Which function gives better results, sqrt or mysqrt? +Which function gives better results, ``sqrt`` or ``mysqrt``? |