-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (36 loc) · 990 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required(VERSION 3.22)
project(myxml
VERSION 0.1)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DDEBUG)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED on)
option(BUILD_TESTING "Build the testing tree." ON)
option(ENABLE_COVERAGE "Enable coverage reporting" ON)
# Code Coverage
if (ENABLE_COVERAGE)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
message(STATUS "Enable code coverage")
set(COVERAGE_FLAGS "--coverage")
else()
message(WARNING "Code coverage is only supported for GCC/Clang")
endif()
endif()
add_subdirectory(deps/fmt)
add_subdirectory(src)
# Installation
install(TARGETS myxml
EXPORT myxml
ARCHIVE DESTINATION lib)
install(DIRECTORY include/
DESTINATION include)
# Testing
if (BUILD_TESTING)
enable_testing()
add_subdirectory(deps/Catch2)
add_subdirectory(tests)
endif()