diff options
author | Betsy McPhail <betsy.mcphail@kitware.com> | 2019-07-18 19:40:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-19 15:49:05 (GMT) |
commit | 6f6a32a0f601688da24e1737509a0b6e1ed4f63f (patch) | |
tree | a8a6f89b0a8126172337f543ebaca43d8a0469c2 /Help/guide/tutorial/index.rst | |
parent | 6a35d630dce6e9da6115cc4acb3393ce62a017ad (diff) | |
download | CMake-6f6a32a0f601688da24e1737509a0b6e1ed4f63f.zip CMake-6f6a32a0f601688da24e1737509a0b6e1ed4f63f.tar.gz CMake-6f6a32a0f601688da24e1737509a0b6e1ed4f63f.tar.bz2 |
Tutorial: Improve Step 9
* Move USE_MYMATH from configured header to target_compile_definitions
Diffstat (limited to 'Help/guide/tutorial/index.rst')
-rw-r--r-- | Help/guide/tutorial/index.rst | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst index f6fd580..d858c25 100644 --- a/Help/guide/tutorial/index.rst +++ b/Help/guide/tutorial/index.rst @@ -645,7 +645,6 @@ The first step is to update the starting section of the top-level .. literalinclude:: Step10/CMakeLists.txt :language: cmake - :start-after: set(CMAKE_CXX_STANDARD 14) :end-before: # add the binary tree Now that we have made MathFunctions always be used, we will need to update @@ -658,7 +657,7 @@ The end result is that ``MathFunctions/CMakeLists.txt`` should look like: .. literalinclude:: Step10/MathFunctions/CMakeLists.txt :language: cmake - :lines: 1-40,46- + :lines: 1-36,42- Next, update ``MathFunctions/mysqrt.cxx`` to use the ``mathfunctions`` and ``detail`` namespaces: @@ -671,6 +670,7 @@ uses ``USE_MYMATH``: #. Always include ``MathFunctions.h`` #. Always use ``mathfunctions::sqrt`` +#. Don't include cmath Finally, update ``MathFunctions/MathFunctions.h`` to use dll export defines: @@ -683,9 +683,14 @@ library that has position enabled code. The solution to this is to explicitly set the ``POSITION_INDEPENDENT_CODE`` target property of SqrtLibrary to be True no matter the build type. +.. literalinclude:: Step10/MathFunctions/CMakeLists.txt + :language: cmake + :lines: 37-42 + **Exercise**: We modified ``MathFunctions.h`` to use dll export defines. Using CMake documentation can you find a helper module to simplify this? + Adding Generator Expressions (Step 10) ====================================== |