-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
63 lines (45 loc) · 1.57 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
cmake_minimum_required(VERSION 3.14.0)
project(HeapWatcher VERSION 0.1.0)
# Determine if fmt is built as a subproject (using add_subdirectory)
# or if it is the master project.
if (NOT DEFINED HEAPWATCHER_IS_MASTER_PROJECT)
set(HEAPWATCHER_IS_MASTER_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(HEAPWATCHER_IS_MASTER_PROJECT ON)
message(STATUS "CMake version: ${CMAKE_VERSION}")
message(STATUS "HeapWatcher is master project")
endif ()
endif ()
# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=*,-fuchsia-default-arguments")
#add_compile_definitions(SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE)
add_compile_definitions(MAX_CALLSTACK_DEPTH_RETAINED=10)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
include(FetchContent)
FetchContent_Declare(
spdlog
GIT_REPOSITORY "https://github.com/gabime/spdlog.git"
GIT_TAG v1.8.2)
FetchContent_MakeAvailable(spdlog)
FetchContent_Declare(
concurrentqueue
GIT_REPOSITORY "https://github.com/cameron314/concurrentqueue.git"
GIT_TAG v1.0.3 )
FetchContent_MakeAvailable(concurrentqueue)
include_directories(
${spdlog_SOURCE_DIR}/include
${spdlog_BIN_DIR}
${concurrentqueue_SOURCE_DIR}
)
enable_testing()
include_directories(include)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
add_subdirectory("src")
if( HEAPWATCHER_IS_MASTER_PROJECT )
add_subdirectory("unit_tests")
endif()