-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathCMakeLists.txt
73 lines (64 loc) · 2.76 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.15.0)
project(cppcookbook)
if(MSVC)
message(status "Setting MSVC flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHc /std:c++latest")
else()
message(status "Setting GCC/Clang flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++2a -fexceptions -g -Wall")
endif()
message(status "** CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
SET(BOOST_PATH "" CACHE STRING "Path to the installation path of Boost")
SET(GTEST_PATH "" CACHE STRING "Path to the installation path of Google Test")
SET(GTEST_PATH_LIB "" CACHE STRING "Path to the Google Test libraries directory")
SET(CATCH_PATH "" CACHE STRING "Path to the installation path of Catch2")
SET(RANGES_PATH "" CACHE STRING "Path to the installation path of Ranges-v3")
SET(CPPCORO_PATH "" CACHE STRING "Path to the installation path of cppcoro")
SET(SKIP_TEST_PROJECTS false CACHE BOOL "Flag to prevent the generation of unit test projects")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
add_subdirectory(chapter01)
add_subdirectory(chapter02)
add_subdirectory(chapter03)
add_subdirectory(chapter04)
add_subdirectory(chapter05)
add_subdirectory(chapter06)
add_subdirectory(chapter07)
add_subdirectory(chapter08)
add_subdirectory(chapter09)
add_subdirectory(chapter10)
if(NOT ${SKIP_TEST_PROJECTS})
add_subdirectory(chapter11/chapter11ca_01)
add_subdirectory(chapter11/chapter11ca_02)
add_subdirectory(chapter11/chapter11ca_03)
add_subdirectory(chapter11/chapter11ca_04)
if(MSVC)
message(status "Setting MSVC flags for Boost and GTest")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHc /std:c++latest")
else()
message(status "Setting GCC/Clang flags for Boost and GTest")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++2a -fexceptions -g -Wall")
endif()
message(status "** CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
add_subdirectory(chapter11/chapter11bt_01_1)
add_subdirectory(chapter11/chapter11bt_01_2)
add_subdirectory(chapter11/chapter11bt_01_3)
add_subdirectory(chapter11/chapter11bt_02)
add_subdirectory(chapter11/chapter11bt_03)
add_subdirectory(chapter11/chapter11bt_04)
add_subdirectory(chapter11/chapter11bt_05)
add_subdirectory(chapter11/chapter11gt_01)
add_subdirectory(chapter11/chapter11gt_02)
add_subdirectory(chapter11/chapter11gt_03)
add_subdirectory(chapter11/chapter11gt_04)
add_subdirectory(chapter11/chapter11gt_05)
else()
message(status "Skipping generating unit testing projects")
endif()
add_subdirectory(chapter12/chapter12_03)
add_subdirectory(chapter12/chapter12_04)
add_subdirectory(chapter12/chapter12_05)
add_subdirectory(chapter12/chapter12_06)
add_subdirectory(chapter12/chapter12_07)
add_subdirectory(chapter12/chapter12_07_1)
add_subdirectory(chapter12/chapter12_08)
add_subdirectory(chapter12/chapter12_08_1)