CMakeLists.txt 612 B

123456789101112131415161718
  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. target_link_libraries(MathFunctions PUBLIC SqrtLibrary)
  14. endif()