-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (63 loc) · 2.11 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.20)
project(fractals)
set(CMAKE_POLICY_DEFAULT_CMP0054 NEW)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# add_compile_options(-Wall -Wextra -Wpedantic -Werror)
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(Boost REQUIRED)
add_subdirectory(dep/STX)
add_subdirectory(dep/spdlog)
add_subdirectory(dep/SDL)
set(FR_HEADERS
src/window.h
src/gfx/vbo.h
src/gfx/vertexarray.h
src/gfx/shader.h
src/gfx/shaderprogram.h
src/common.h
src/maths/mat4.h
src/gfx/texture2d.h
src/gfx/ebo.h)
set(FR_SRCS
src/gfx/vbo.cpp
src/gfx/vertexarray.cpp
src/gfx/shader.cpp
src/gfx/shaderprogram.cpp
src/main.cpp
src/window.cpp
src/gfx/ebo.cpp)
set(IMGUI_HDRS
src/util/imconfig.h
src/util/imgui.h
src/util/imgui_internal.h
src/util/imstb_rectpack.h
src/util/imstb_textedit.h
src/util/imstb_truetype.h
src/util/backends/imgui_impl_sdl.h
src/util/backends/imgui_impl_opengl3.h
src/util/backends/imgui_impl_sdlrenderer.h)
set(IMGUI_SRCS
src/util/imgui.cpp
src/util/imgui_draw.cpp
src/util/imgui_tables.cpp
src/util/imgui_widgets.cpp
src/util/backends/imgui_impl_opengl3.cpp
src/util/backends/imgui_impl_sdl.cpp
src/util/backends/imgui_impl_sdlrenderer.cpp)
add_executable(fractals ${FR_SRCS} ${FR_HEADERS} ${IMGUI_SRCS} ${IMGUI_HDRS})
target_include_directories(fractals PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_include_directories(fractals PUBLIC ${Boost_INCLUDE_DIRS})
target_include_directories(fractals PUBLIC OpenGL::GL)
target_include_directories(fractals PUBLIC GLEW::glew)
target_include_directories(fractals PUBLIC stx::include)
target_include_directories(fractals PUBLIC spdlog)
target_include_directories(fractals PUBLIC SDL2::Video)
target_link_libraries(fractals
GLEW::glew
OpenGL::GL
${CMAKE_DL_LIBS})
target_link_libraries(fractals stx)
target_link_libraries(fractals spdlog)
target_link_libraries(fractals SDL2)