CMakeLists.txt 783 B

12345678910111213141516171819202122232425
  1. # create the MathFunctions library
  2. add_library(MathFunctions MathFunctions.cxx)
  3. # state that anybody linking to us needs to include the current source dir
  4. # to find MathFunctions.h, while we don't.
  5. target_include_directories(MathFunctions
  6. INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
  7. )
  8. # should we use our own math functions
  9. option(USE_MYMATH "Use tutorial provided math implementation" ON)
  10. if (USE_MYMATH)
  11. target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
  12. # library that just does sqrt
  13. add_library(SqrtLibrary STATIC
  14. mysqrt.cxx
  15. )
  16. # TODO 4: Link to tutorial_compiler_flags
  17. target_link_libraries(MathFunctions PUBLIC SqrtLibrary)
  18. endif()
  19. # TODO 3: Link to tutorial_compiler_flags