-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
119 lines (96 loc) · 3.72 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
cmake_minimum_required (VERSION 3.11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
set(BUILD_BENCHMARKS OFF CACHE INTERNAL "Turn off")
set(BUILD_EXAMPLES OFF CACHE INTERNAL "Turn off")
set(BUILD_UNIT_TESTS OFF CACHE INTERNAL "Turn off")
set(BUILD_DOCUMENTATION OFF CACHE INTERNAL "Turn off")
set(FTXUI_BUILD_EXAMPLES OFF CACHE INTERNAL "Turn off")
set(FTXUI_BUILD_DOCS OFF CACHE INTERNAL "Turn off")
include(FetchContent)
set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
# --- Fetch FTXUI --------------------------------------------------------------
FetchContent_Declare(ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
GIT_TAG 4188ee2c046ced00cd3accba4cde2318587f8c8a
)
# ------------------------------------------------------------------------------
add_subdirectory(external_libs/libag)
# ------------------------------------------------------------------------------
# These external dependencies could not be fetched using github directly. (above method)
include_directories(external_libs/libag)
include_directories(external_libs/rangeless/include)
include_directories(external_libs/clipp/include)
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Dependencies used only for development and testing
# ------------------------------------------------------------------------------
FetchContent_Declare(fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
GIT_TAG 1266c2b6003e6391046bbab57dcf20293e25dedd
)
# ------------------------------------------------------------------------------
FetchContent_Declare(RTTR
GIT_REPOSITORY https://github.com/rttrorg/rttr
GIT_TAG e338d9aa47f6c7da97be88df3aaa48ac9c5fe6c6
)
# ------------------------------------------------------------------------------
FetchContent_Declare(nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json
GIT_TAG 7194245a314d142a5560f6906a87f7c67ebbcf2e
)
# ------------------------------------------------------------------------------
include_directories(external_libs/catch2)
# ------------------------------------------------------------------------------
# End of dependencies used only for development and testing
# ------------------------------------------------------------------------------
# Cmake will download all the required deps and install them.
FetchContent_MakeAvailable(ftxui fmt RTTR nlohmann_json)
project(tabdeeli
LANGUAGES CXX
VERSION 1.0.0
)
add_executable(tabdeeli
src/main.cpp
src/components.cpp
src/searcher.cpp
src/object_utils.cpp
src/utils.cpp
src/styled_button.cpp
src/metaprogramming.cpp
src/flexible_paragraph.cpp
src/flexible_menu.cpp
src/flexible_container.cpp
src/flexible_input.cpp
)
add_executable(tabdeeli_unit_tests
tests/unit_tests.cpp
src/utils.cpp
src/metaprogramming.cpp
src/searcher.cpp
)
target_include_directories(tabdeeli PRIVATE src)
target_include_directories(tabdeeli_unit_tests PRIVATE src)
target_link_libraries(tabdeeli
PRIVATE ag
PRIVATE fmt::fmt
PRIVATE ftxui::screen
PRIVATE ftxui::dom
PRIVATE ftxui::component # Not needed for this example.
PRIVATE RTTR::Core
PRIVATE nlohmann_json::nlohmann_json
PUBLIC stdc++
)
target_link_libraries(tabdeeli_unit_tests
PRIVATE ag
PRIVATE fmt::fmt
PRIVATE ftxui::screen
PRIVATE ftxui::dom
PRIVATE ftxui::component # Not needed for this example.
PRIVATE RTTR::Core
PRIVATE nlohmann_json::nlohmann_json
PUBLIC stdc++
)
install(TARGETS tabdeeli RUNTIME DESTINATION "bin")