-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
63 lines (53 loc) · 1.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
cmake_minimum_required(VERSION 3.10)
project(ImGUI-Example)
# use C++17 (in case std::fs needed)
set(CMAKE_CXX_STANDARD 17)
# autocomplete with YCM & debug with gdb
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_BUILD_TYPE Release)
# set(CMAKE_BUILD_TYPE Debug)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=leak")
# copy assets folder
file(COPY assets DESTINATION ${CMAKE_BINARY_DIR})
# imgui library (preprocessor definition to force it to use glad)
add_compile_definitions(IMGUI_IMPL_OPENGL_LOADER_GLAD)
file(GLOB IMGUI_SRC "src/imgui/*.cpp")
add_library(imgui SHARED ${IMGUI_SRC})
target_include_directories(imgui PUBLIC include/imgui include)
# filedialog extension for imgui
add_library(file_dialog SHARED src/ImGuiFileDialog/ImGuiFileDialog.cpp)
target_include_directories(file_dialog PUBLIC include/ImGuiFileDialog include/imgui)
# header-only font icons library
add_library(icon_font INTERFACE)
target_include_directories(icon_font INTERFACE include/IconFontCppHeaders)
# nanosvg shared library (prevent from loading file multiple times)
# add_compile_definitions(NANOVG_GL3_IMPLEMENTATION)
add_library(nanovg SHARED
"src/nanovg/nanovg.c"
)
target_include_directories(nanovg PUBLIC include/nanovg)
# glfw window & opengl utils (texture, shader, fbo) libraries from submodule
add_subdirectory(glfw-window)
add_subdirectory(opengl-utils)
# main executable
file(GLOB SRC
"src/ui/*.cpp"
"src/ui/enumerations/*.cpp"
"src/ui/tooltips/*.cpp"
"src/ui/listeners/*.cpp"
"src/ui/globals/*.cpp"
"src/image/*.cpp"
"src/fonts/*.cpp"
"src/profiling/*.cpp"
"src/geometries/*.cpp"
"src/main.cpp"
)
add_executable(main ${SRC})
target_link_libraries(main
nanovg
imgui
file_dialog
icon_font
glfw_window
opengl_utils
)