forked from cpp-best-practices/gui_starter_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
34 lines (23 loc) · 843 Bytes
/
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
cmake_minimum_required(VERSION 3.2)
# Link this 'library' to use the following warnings
add_library(project_warnings INTERFACE)
if (CMAKE_COMPILER_IS_GNUCC)
option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" FALSE)
if (ENABLE_COVERAGE)
add_compile_options(--coverage -O0)
endif()
endif()
if (MSVC)
target_compile_options(project_warnings INTERFACE /W4)
else()
target_compile_options(project_warnings INTERFACE -Wall -Wextra -Wpedantic)
endif()
add_executable(intro main.cpp)
target_compile_features(intro PRIVATE cxx_lambda_init_captures)
target_link_libraries(intro PRIVATE project_warnings)
target_link_libraries(intro --coverage)
enable_testing()
add_executable(tester tester.cpp)
target_link_libraries(tester PRIVATE project_warnings)
target_link_libraries(tester --coverage)
add_test(Tester tester)