|
@@ -9,17 +9,15 @@ tutorial assume that they are not common.
|
|
|
|
|
|
If the platform has ``log`` and ``exp`` then we will use them to compute the
|
|
|
square root in the ``mysqrt`` function. We first test for the availability of
|
|
|
-these functions using the :module:`CheckSymbolExists` module in
|
|
|
-``MathFunctions/CMakeLists.txt``. On some platforms, we will need to link to
|
|
|
-the ``m`` library. If ``log`` and ``exp`` are not initially found, require the
|
|
|
-``m`` library and try again.
|
|
|
+these functions using the :module:`CheckCXXSourceCompiles` module in
|
|
|
+``MathFunctions/CMakeLists.txt``.
|
|
|
|
|
|
Add the checks for ``log`` and ``exp`` to ``MathFunctions/CMakeLists.txt``,
|
|
|
after the call to :command:`target_include_directories`:
|
|
|
|
|
|
.. literalinclude:: Step6/MathFunctions/CMakeLists.txt
|
|
|
:caption: MathFunctions/CMakeLists.txt
|
|
|
- :name: MathFunctions/CMakeLists.txt-check_symbol_exists
|
|
|
+ :name: MathFunctions/CMakeLists.txt-check_cxx_source_compiles
|
|
|
:language: cmake
|
|
|
:start-after: # to find MathFunctions.h, while we don't.
|
|
|
:end-before: # add compile definitions
|