CMakeLists.txt 828 B

1234567891011121314151617181920212223242526272829
  1. cmake_minimum_required(VERSION 3.23)
  2. project(Tutorial)
  3. option(TUTORIAL_BUILD_UTILITIES "Build the Tutorial executable" ON)
  4. option(TUTORIAL_USE_STD_SQRT "Use std::sqrt" OFF)
  5. option(TUTORIAL_ENABLE_IPO "Check for and use IPO support" ON)
  6. # TODO6: Add a default-ON option named BUILD_TESTING with a doc string of:
  7. # "Enable testing and build tests"
  8. if(TUTORIAL_ENABLE_IPO)
  9. include(CheckIPOSupported)
  10. check_ipo_supported(RESULT result OUTPUT output)
  11. if(result)
  12. set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
  13. else()
  14. message(WARNING "IPO is not supported ${message}")
  15. endif()
  16. endif()
  17. if(TUTORIAL_BUILD_UTILITIES)
  18. add_subdirectory(Tutorial)
  19. endif()
  20. # TODO7: Conditional on the value of BUILD_TESTING, enable testing and add the
  21. # Tests subdirectory to the project
  22. add_subdirectory(MathFunctions)