Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Help/guide/tutorial/Step7/CMakeLists.txt
5017 views
1
cmake_minimum_required(VERSION 3.23)
2
3
project(Tutorial)
4
5
option(TUTORIAL_BUILD_UTILITIES "Build the Tutorial executable" ON)
6
option(TUTORIAL_USE_STD_SQRT "Use std::sqrt" OFF)
7
option(TUTORIAL_ENABLE_IPO "Check for and use IPO support" ON)
8
9
if(TUTORIAL_ENABLE_IPO)
10
include(CheckIPOSupported)
11
check_ipo_supported(RESULT result OUTPUT output)
12
if(result)
13
message("IPO is supported, enabling IPO")
14
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
15
else()
16
message(WARNING "IPO is not supported: ${output}")
17
endif()
18
endif()
19
20
21
if(TUTORIAL_BUILD_UTILITIES)
22
add_subdirectory(Tutorial)
23
endif()
24
25
add_subdirectory(MathFunctions)
26
27