CMakeLists.txt 727 B

12345678910111213141516171819202122
  1. add_library(MathFunctions MathFunctions.cxx)
  2. # TODO 1: State that anybody linking to MathFunctions needs to include the
  3. # current source directory, while MathFunctions itself doesn't.
  4. # Hint: Use target_include_directories with the INTERFACE keyword
  5. # should we use our own math functions
  6. option(USE_MYMATH "Use tutorial provided math implementation" ON)
  7. if (USE_MYMATH)
  8. target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
  9. # library that just does sqrt
  10. add_library(SqrtLibrary STATIC
  11. mysqrt.cxx
  12. )
  13. # TODO 7: Link SqrtLibrary to tutorial_compiler_flags
  14. target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
  15. endif()
  16. # TODO 6: Link MathFunctions to tutorial_compiler_flags