Path: blob/master/Help/guide/tutorial/Step9/CMakeLists.txt
5018 views
cmake_minimum_required(VERSION 3.23)12# TODO9: Add a VERSION parameter to the project() command for version 1.0.03project(Tutorial)45option(TUTORIAL_BUILD_UTILITIES "Build the Tutorial executable" ON)6option(TUTORIAL_USE_STD_SQRT "Use std::sqrt" OFF)7option(TUTORIAL_ENABLE_IPO "Check for and use IPO support" ON)8option(BUILD_TESTING "Enable testing and build tests" ON)910if(TUTORIAL_ENABLE_IPO)11include(CheckIPOSupported)12check_ipo_supported(RESULT result OUTPUT output)13if(result)14message("IPO is supported, enabling IPO")15set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)16else()17message(WARNING "IPO is not supported: ${output}")18endif()19endif()2021if(TUTORIAL_BUILD_UTILITIES)22add_subdirectory(Tutorial)23# TODO1: Install the Tutorial target2425# TODO3: Add the Tutorial target to the TutorialTargets export26endif()2728if(BUILD_TESTING)29enable_testing()30add_subdirectory(Tests)31endif()3233add_subdirectory(MathFunctions)3435# TODO4: Include the GNUInstallDirs module3637# TODO2: Install the MathFunctions, OpAdd, OpMul, OpSub, SqrtTable, and38# MathLogger targets. Ensure you name their header file set so the39# headers will be installed.4041# TODO5: Add the targets from TODO2 to the TutorialTargets export4243# TODO6: Install the TutorialTargets export to:44# ${CMAKE_INSTALL_LIBDIR}/cmake/Tutorial45# And give them a namespace of "Tutorial::"4647# TODO10: Include CMakePackageConfigHelpers4849# TODO11: Use write_basic_package_version_file to write a50# TutorialConfigVersion.cmake file to the CMAKE_CURRENT_BINARY_DIR.51# The version compatibility should be ExactVersion.5253# TODO12: Add the generated TutorialConfigVersion.cmake file to the file list54# of the TODO7 install() command.5556# TODO7: Install the config file at cmake/TutorialConfig.cmake to the same57# destination as the TutorialTargets export.585960