-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
95 lines (77 loc) · 2.75 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
cmake_minimum_required(VERSION 3.5)
project(vis_actrie_app VERSION 0.1.0 LANGUAGES C CXX)
option(VIS_ACTRIE_APP_STATIC_LINK_GCC_STD_WINPTHREAD "Statically link C and C++ standart libraries and Win pthread when using GCC on Windows" OFF)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(IMGUI_BACKENDS_DIR "${PROJECT_SOURCE_DIR}/external/imgui/backends")
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(external) # For ImGui
add_subdirectory(external/glad)
add_subdirectory(external/glfw)
add_executable(vis_actrie_app
main.cpp
App/App.cpp
App/ACTrie.cpp
App/ACTrieController.cpp
App/React.cpp
GraphicsUtils/Drawer.cpp
GraphicsUtils/DrawerUtils/StringHistoryManager.cpp
GraphicsUtils/DrawerUtils/Logger.cpp
GraphicsUtils/GLFWFacade.cpp
GraphicsUtils/ImGuiFacade.cpp
"${IMGUI_BACKENDS_DIR}/imgui_impl_glfw.cpp"
"${IMGUI_BACKENDS_DIR}/imgui_impl_opengl3.cpp"
)
include_directories(${IMGUI_BACKENDS_DIR})
target_link_libraries(vis_actrie_app glad glfw imgui)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
elseif (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(vis_actrie_app PRIVATE
_LIBCPP_ENABLE_ASSERTIONS=1
)
endif()
elseif (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "AppleClang")
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(vis_actrie_app PRIVATE
_GLIBCXX_DEBUG
_GLIBCXX_DEBUG_PEDANTIC
)
endif()
target_compile_options(vis_actrie_app PRIVATE
-Wall
-Wextra
-Wlogical-op
-Wcast-qual
-Wpedantic
-Wshift-overflow=2
-Wduplicated-cond
-Wunused
-Wconversion
-Wunsafe-loop-optimizations
-Wshadow
-Wnull-dereference
-Wundef
-Wwrite-strings
-Wsign-conversion
-Wmissing-noreturn
-Wunreachable-code
-Wcast-align
-Warray-bounds=2
-Wformat=2
)
if (VIS_ACTRIE_APP_STATIC_LINK_GCC_STD_WINPTHREAD)
target_link_options(vis_actrie_app PRIVATE -static)
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
endif()
get_target_property(APP_COMPILATION_OPTIONS vis_actrie_app COMPILE_OPTIONS)
get_target_property(APP_LINK_OPTIONS vis_actrie_app LINK_OPTIONS)
message(STATUS "Additional app compilation options: ${APP_COMPILATION_OPTIONS}")
message(STATUS "Additional app link options: ${APP_LINK_OPTIONS}")