CMakeLists.txt 824 B

12345678910111213141516171819202122
  1. add_library(MathFunctions MathFunctions.cxx mysqrt.cxx)
  2. # state that anybody linking to us needs to include the current source dir
  3. # to find MathFunctions.h, while we don't.
  4. target_include_directories(MathFunctions
  5. INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
  6. )
  7. # should we use our own math functions
  8. option(USE_MYMATH "Use tutorial provided math implementation" ON)
  9. if (USE_MYMATH)
  10. target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
  11. endif()
  12. # link our compiler flags interface library
  13. target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
  14. # install libs
  15. set(installable_libs MathFunctions tutorial_compiler_flags)
  16. install(TARGETS ${installable_libs} DESTINATION lib)
  17. # install include headers
  18. install(FILES MathFunctions.h DESTINATION include)