summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-17 14:42:26 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-17 14:42:32 (GMT)
commit93d414861251cb6c88021756f53621160b98bf96 (patch)
treed44e2393047f8166b2a82a426fed00c9b2ba9cd3 /Help
parenta7fca06c464e7de3267a734aa26c043901b92f43 (diff)
parentfc2d1b1347aac66ce8a45f3d272714d31ba65810 (diff)
downloadCMake-93d414861251cb6c88021756f53621160b98bf96.zip
CMake-93d414861251cb6c88021756f53621160b98bf96.tar.gz
CMake-93d414861251cb6c88021756f53621160b98bf96.tar.bz2
Merge topic 'step5'
fc2d1b1347 Tutorial: Clarify Step 5 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4231
Diffstat (limited to 'Help')
-rw-r--r--Help/guide/tutorial/index.rst14
1 files changed, 10 insertions, 4 deletions
diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst
index 5da7543..96f0486 100644
--- a/Help/guide/tutorial/index.rst
+++ b/Help/guide/tutorial/index.rst
@@ -397,16 +397,22 @@ from ``mysqrt.cxx``:
#cmakedefine HAVE_LOG
#cmakedefine HAVE_EXP
-Modify ``mysqrt.cxx`` to include cmath. Next, in that same file in the
-``mysqrt`` function we can provide an alternate implementation based on
-``log`` and ``exp`` if they are available on the system using the following
-code (don't forget the ``#endif`` before returning the result!):
+If ``log`` and ``exp`` are available on the system, then we will use them to
+compute the square root in the ``mysqrt`` function. Add the following code to
+the ``mysqrt`` function in ``MathFunctions/mysqrt.cxx`` (don't forget the
+``#endif`` before returning the result!):
.. literalinclude:: Step6/MathFunctions/mysqrt.cxx
:language: c++
:start-after: // if we have both log and exp then use them
:end-before: // do ten iterations
+We will also need to modify ``mysqrt.cxx`` to include ``cmath``.
+
+.. literalinclude:: Step6/MathFunctions/mysqrt.cxx
+ :language: c++
+ :end-before: #include <iostream>
+
Run the :manual:`cmake <cmake(1)>` executable or the
:manual:`cmake-gui <cmake-gui(1)>` to configure the project and then build it
with your chosen build tool and run the Tutorial executable.