-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (52 loc) · 1.67 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
cmake_minimum_required(VERSION 3.20)
### before-project config ###
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
#############################
### project setup ###
project(change-me
VERSION 1.0.0
HOMEPAGE_URL "https://github.com/JungerBoyo/minimal-cpp-template-project"
)
######################
### sub dirs ###
if (DEFINED SANITIZE_ADDRESS)
if (DEFINED SANITIZE_THREAD)
message(FATAL_ERROR "Can't combine thread and address sanitizer")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
endif()
endif()
if (DEFINED SANITIZE_MEMORY)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message(WARNING "Memory sanitizer not offcially supported for GCC")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=memory")
endif()
endif()
if (DEFINED SANITIZE_THREAD)
if (DEFINED SANITIZE_LEAK)
message(FATAL_ERROR "Can't combine thread and leak sanitizer")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
endif()
endif()
if (DEFINED SANITIZE_UNDEFINED_BEHAVIOUR)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
endif()
if (DEFINED SANITIZE_LEAK)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=leak")
endif()
add_subdirectory(src)
################
### add conan install as dependency ###
### package project ###
install(TARGETS change-me RUNTIME DESTINATION "./")
# install(TARGETS some-lib DESTINATION "./lib/")
# install(FILES
# ${CMAKE_CURRENT_SOURCE_DIR}/.../some_include.h
# DESTINATION "./include/")
#
# install(DIRECTORY ${PROJECT_SOURCE_DIR}/.../some_dir DESTINATION "./some_dir/")
include(CPack)
########################