Path: blob/master/Help/guide/tutorial/Step8/CMakeLists.txt
5017 views
cmake_minimum_required(VERSION 3.23)12project(Tutorial)34option(TUTORIAL_BUILD_UTILITIES "Build the Tutorial executable" ON)5option(TUTORIAL_USE_STD_SQRT "Use std::sqrt" OFF)6option(TUTORIAL_ENABLE_IPO "Check for and use IPO support" ON)78# TODO6: Add a default-ON option named BUILD_TESTING with a doc string of:9# "Enable testing and build tests"1011if(TUTORIAL_ENABLE_IPO)12include(CheckIPOSupported)13check_ipo_supported(RESULT result OUTPUT output)14if(result)15message("IPO is supported, enabling IPO")16set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)17else()18message(WARNING "IPO is not supported: ${output}")19endif()20endif()2122if(TUTORIAL_BUILD_UTILITIES)23add_subdirectory(Tutorial)24endif()2526# TODO7: Conditional on the value of BUILD_TESTING, enable testing and add the27# Tests subdirectory to the project2829add_subdirectory(MathFunctions)303132