This repository has been archived by the owner on Jun 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
74 lines (63 loc) · 2.33 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
74
cmake_minimum_required(VERSION 3.14)
project(client-cpp LANGUAGES CXX)
# GoogleTest requires are least C++14
set(CMAKE_CXX_STANDARD 14)
# Here, we must include the CTest, because we
# call `enabletesting` internally.
# See https://stackoverflow.com/questions/13550153/no-tests-found-when-using-gtest-with-cmake-ctest
include(CTest)
# Here we use CMake `FetchContent` module to download
# the dependency to the build system
# See https://cmake.org/cmake/help/latest/module/FetchContent.html
# And the code snippet is copied from the GTest docs.
# See https://google.github.io/googletest/quickstart-cmake.html
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.1
)
FetchContent_MakeAvailable(googletest)
# See https://cmake.org/cmake/help/latest/module/FindDoxygen.html
find_package(Doxygen
REQUIRED dot
OPTIONAL_COMPONENTS mscgen dia)
if(DOXYGEN_FOUND)
set(DOXYGEN_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/docs)
# Here we must make Doxygen do not generate
# the docs for dependency
# See https://cmake.org/cmake/help/latest/module/FindDoxygen.html#variable:DOXYGEN_EXCLUDE_PATTERNS
set(DOXYGEN_EXCLUDE_PATTERNS "*/_deps/*")
doxygen_add_docs(DOXYGEN ${PROJECT_SOURCE_DIR})
set(DOXYGEN_COLLABORATION_GRAPH YES)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_CLASS_DIAGRAMS YES)
set(DOXYGEN_HIDE_UNDOC_RELATIONS NO)
set(DOXYGEN_HAVE_DOT YES)
set(DOXYGEN_CLASS_GRAPH YES)
set(DOXYGEN_CALL_GRAPH YES)
set(DOXYGEN_CALLER_GRAPH YES)
set(DOXYGEN_COLLABORATION_GRAPH YES)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_EXTRACT_PRIVATE YES)
set(DOXYGEN_EXTRACT_PACKAGE YES)
set(DOXYGEN_EXTRACT_STATIC YES)
set(DOXYGEN_EXTRACT_LOCALMETHODS YES)
set(DOXYGEN_UML_LOOK YES)
set(DOXYGEN_UML_LIMIT_NUM_FIELDS 50)
set(DOXYGEN_TEMPLATE_RELATIONS YES)
set(DOXYGEN_DOT_GRAPH_MAX_NODES 100)
set(DOXYGEN_MAX_DOT_GRAPH_DEPTH 0)
set(DOXYGEN_DOT_TRANSPARENT YES)
else()
message("Doxygen need to be installed to generate the doxygen documentation")
endif()
# We need to add the dependency directory for spdlog
add_subdirectory(./deps/spdlog)
# See https://github.com/gabime/spdlog/blob/v1.x/example/CMakeLists.txt
if(NOT TARGET spdlog)
find_package(spdlog REQUIRED)
endif()
include_directories(./include/)
add_subdirectory(./util)
add_subdirectory(./sidecar)