1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-24 03:02:46 +08:00
Files
CMake/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt
betsy.mcphail a94a4c12e1 Tutorial: Fix-up typos and inconsistencies
* Fix typo in Step 2
* Fix incorrect code referenced in Step 3, TODO 7. Update comments in
MathFunctions/CMakeLists.txt to unique strings.
* Resolve inconsistencies between steps in MathFunctions/CMakeLists.txt
2023-09-07 10:57:19 -04:00

23 lines
727 B
CMake

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
)
# TODO 7: Link SqrtLibrary to tutorial_compiler_flags
target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
endif()
# TODO 6: Link MathFunctions to tutorial_compiler_flags