summaryrefslogtreecommitdiff
path: root/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt')
-rw-r--r--Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt15
1 files changed, 14 insertions, 1 deletions
diff --git a/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt
index 7bf05e02c5..6f86ffef5b 100644
--- a/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt
@@ -1,5 +1,18 @@
-add_library(MathFunctions mysqrt.cxx)
+add_library(MathFunctions MathFunctions.cxx)
# TODO 1: State that anybody linking to MathFunctions needs to include the
# current source directory, while MathFunctions itself doesn't.
# Hint: Use target_include_directories with the INTERFACE keyword
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+if (USE_MYMATH)
+ target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
+
+ # library that just does sqrt
+ add_library(SqrtLibrary STATIC
+ mysqrt.cxx
+ )
+
+ target_link_libraries(MathFunctions PUBLIC SqrtLibrary)
+endif()