Index

zydeco / 7457fba

Experiment in graphics programming, C++, OpenGL, simulation techniques.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
803 Sep 2023 23:177457fbaImGui bringupJosh Stockin1185G

Blob @ zydeco / CMakeLists.txt

text/plain2012 bytesdownload raw
1# CMake info
2cmake_minimum_required(VERSION 3.22)
3
4project("zydeco")
5
6
7# Locations
8set(SOURCE_DIR "src")
9set(LIB_SOURCE_DIR "lib")
10set(INCLUDE_DIR
11 "lib/imgui"
12 "lib/gl3w/include"
13 "include"
14 "include/events"
15 "include/render"
16 "include/render/gl"
17 "include/render/objects"
18 "include/render/shaders"
19 "include/runtime"
20 "include/sdl2"
21)
22
23
24# Compile settings
25set(CMAKE_CXX_STANDARD 20)
26set(COMPILE_OPTIONS "-O3 -Wall -Wextra -pedantic")
27
28if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
29 add_compile_options (-fdiagnostics-color=always)
30elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
31 add_compile_options (-fcolor-diagnostics)
32endif ()
33
34
35# Add source files
36include_directories(${INCLUDE_DIR})
37
38set(LIB_SOURCES
39 "${LIB_SOURCE_DIR}/gl3w/src/gl3w.c"
40 "${LIB_SOURCE_DIR}/imgui/imgui.cpp"
41 "${LIB_SOURCE_DIR}/imgui/imgui_demo.cpp"
42 "${LIB_SOURCE_DIR}/imgui/imgui_draw.cpp"
43 "${LIB_SOURCE_DIR}/imgui/imgui_tables.cpp"
44 "${LIB_SOURCE_DIR}/imgui/imgui_widgets.cpp"
45 "${LIB_SOURCE_DIR}/imgui/backends/imgui_impl_sdl2.cpp"
46 "${LIB_SOURCE_DIR}/imgui/backends/imgui_impl_opengl3.cpp"
47)
48
49set(PROGRAM_SOURCES
50 "${SOURCE_DIR}/main.cpp"
51 "${SOURCE_DIR}/Engine.cpp"
52 "${SOURCE_DIR}/render/Renderer.cpp"
53 "${SOURCE_DIR}/render/gl/GLProgram.cpp"
54 "${SOURCE_DIR}/render/gl/GLShader.cpp"
55 "${SOURCE_DIR}/render/gl/GLRenderObject.cpp"
56 "${SOURCE_DIR}/render/objects/GLRenderObjectBackground.cpp"
57 "${SOURCE_DIR}/render/objects/GLRenderObjectRainbowTriangle.cpp"
58 "${SOURCE_DIR}/render/objects/GLRenderObjectImGui.cpp"
59 "${SOURCE_DIR}/runtime/ThreadLooping.cpp"
60 "${SOURCE_DIR}/sdl2/EventHandlerSDL2.cpp"
61 "${SOURCE_DIR}/sdl2/TimerSDL2.cpp"
62 "${SOURCE_DIR}/sdl2/WindowSDL2.cpp"
63 "${SOURCE_DIR}/util/Fault.cpp"
64 "${SOURCE_DIR}/util/Logger.cpp"
65)
66
67
68# Link libraries
69find_package(cpptrace REQUIRED)
70link_libraries("fmt" "cpptrace::cpptrace" "SDL2" "GL" "stb")
71
72
73# Output
74add_executable("zydeco" ${LIB_SOURCES} ${PROGRAM_SOURCES})
75