-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
148 lines (131 loc) · 4.39 KB
/
CMakeLists.txt
File metadata and controls
148 lines (131 loc) · 4.39 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
cmake_minimum_required(VERSION 3.20)
project(Convoy VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/cmake")
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/v1.13.0.zip
)
FetchContent_MakeAvailable(googletest)
find_package(OpenGL QUIET)
# Try vcpkg config-mode first (when toolchain is active), then fall back to custom finders
find_package(glfw3 CONFIG QUIET)
if(glfw3_FOUND AND NOT TARGET GLFW3::GLFW3)
add_library(GLFW3::GLFW3 ALIAS glfw)
set(GLFW3_FOUND TRUE)
else()
find_package(GLFW3 3.4 QUIET)
endif()
find_package(GLAD QUIET)
find_package(ImGui QUIET)
add_library(convoy_core)
target_include_directories(convoy_core PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/third_party/imgui
${CMAKE_CURRENT_SOURCE_DIR}/third_party/imgui/backends
${CMAKE_CURRENT_SOURCE_DIR}/third_party/glad/include
)
if(GLFW3_FOUND AND OpenGL_FOUND AND GLAD_FOUND AND ImGui_FOUND)
target_sources(convoy_core PRIVATE
src/core/window_manager.cpp
src/core/event_bus.cpp
src/core/ui/theme_manager.cpp
src/core/ui/dockspace_manager.cpp
src/core/ui/main_menu_bar.cpp
src/core/ui/export_wizard.cpp
src/core/ui/preferences_window.cpp
src/core/ui/pressure_curve_editor.cpp
src/core/ui/new_project_dialog.cpp
src/core/input/input_handler.cpp
src/core/gfx/render_texture.cpp
src/core/keybind_manager.cpp
)
target_link_libraries(convoy_core PUBLIC
GLFW3::GLFW3
OpenGL::GL
GLAD::GLAD
ImGui::ImGui
)
target_compile_definitions(convoy_core PRIVATE
GLFW_INCLUDE_NONE
IMGUI_IMPL_OPENGL_LOADER_GLAD
_CRT_SECURE_NO_WARNINGS
)
else()
target_sources(convoy_core PRIVATE src/core/event_bus.cpp)
endif()
target_sources(convoy_core PRIVATE
src/core/cvp_format.cpp
src/core/filesystem.cpp
src/core/command_manager.cpp
src/core/commands/pixel_command.cpp
src/core/plugins/plugin_registry.cpp
src/core/plugins/hook_system.cpp
src/core/export/caf_exporter.cpp
src/core/settings_config.cpp
src/core/project_template.cpp
src/shared/brush.cpp
)
add_library(mod_architect
src/modules/mod_architect/canvas.cpp
src/modules/mod_architect/viewport.cpp
src/modules/mod_architect/tools/pencil_tool.cpp
src/modules/mod_architect/tools/eraser_tool.cpp
src/modules/mod_architect/tools/bucket_tool.cpp
src/modules/mod_architect/tools/pivot_tool.cpp
src/modules/mod_architect/tools/hitbox_tool.cpp
src/modules/mod_architect/tools/brush_stroke.cpp
)
target_include_directories(mod_architect PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(mod_architect PUBLIC convoy_core)
if(GLFW3_FOUND AND OpenGL_FOUND AND GLAD_FOUND AND ImGui_FOUND)
target_sources(mod_architect PRIVATE
src/modules/mod_architect/architect_ui.cpp
src/modules/mod_architect/ui/color_palette.cpp
src/modules/mod_architect/ui/dod_visualizer.cpp
src/modules/mod_architect/ui/live_preview.cpp
)
endif()
if(GLFW3_FOUND AND OpenGL_FOUND AND GLAD_FOUND AND ImGui_FOUND)
add_library(mod_walker src/modules/mod_walker/walker_ui.cpp)
target_include_directories(mod_walker PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(mod_walker PUBLIC convoy_core)
add_library(mod_forge src/modules/mod_forge/forge_ui.cpp)
target_include_directories(mod_forge PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(mod_forge PUBLIC convoy_core)
add_library(mod_sequencer src/modules/mod_sequencer/sequencer_ui.cpp)
target_include_directories(mod_sequencer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(mod_sequencer PUBLIC convoy_core)
endif()
if(GLFW3_FOUND AND OpenGL_FOUND AND GLAD_FOUND AND ImGui_FOUND)
add_executable(convoy
src/convoy/main.cpp
)
target_link_libraries(convoy PRIVATE
convoy_core
mod_architect
mod_walker
mod_forge
mod_sequencer
GLFW3::GLFW3
glfw
OpenGL::GL
GLAD::GLAD
)
endif()
if(MSVC)
target_compile_options(convoy_core PRIVATE /W4 /WX)
if(TARGET convoy)
target_compile_options(convoy PRIVATE /W4 /WX)
endif()
else()
target_compile_options(convoy_core PRIVATE -Wall -Wextra -Wpedantic -Werror)
if(TARGET convoy)
target_compile_options(convoy PRIVATE -Wall -Wextra -Wpedantic -Werror)
endif()
endif()
enable_testing()
add_subdirectory(tests)