This repository has been archived by the owner on Aug 10, 2021. It is now read-only.
forked from kosua20/MIDIVisualizer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
128 lines (108 loc) · 3.35 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
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
cmake_minimum_required(VERSION 3.8)
project(MIDIVisualizer)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE "Release")
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
## Dependencies
# Add GLFW
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
add_subdirectory(libs/glfw/)
# Add NativeFileDialog
add_subdirectory(libs/nfd/)
# Add OpenGL
find_package(OpenGL REQUIRED)
## Projects
# Helper packager
set(PackagerSources
"src/libs/lodepng/lodepng.h"
"src/libs/lodepng/lodepng.cpp"
"src/packager.cpp" )
include_directories(src/libs/)
add_executable(Packager ${PackagerSources})
# Target for packaging data in source files.
add_custom_target(Packaging
COMMAND $<TARGET_FILE_DIR:Packager>/$<TARGET_FILE_NAME:Packager> ${PROJECT_SOURCE_DIR}
DEPENDS Packager)
# MIDIVisualizer
file(GLOB GlmSources
"src/libs/glm/*.hpp"
"src/libs/glm/*/*.hpp"
"src/libs/glm/*/*.inl"
)
set(LibSources
"src/libs/gl3w/gl3w.cpp"
"src/libs/gl3w/gl3w.h"
"src/libs/gl3w/glcorearb.h"
"src/libs/imgui/imconfig.h"
"src/libs/imgui/imgui.cpp"
"src/libs/imgui/imgui.h"
"src/libs/imgui/imgui_demo.cpp"
"src/libs/imgui/imgui_draw.cpp"
"src/libs/imgui/imgui_impl_glfw.cpp"
"src/libs/imgui/imgui_impl_glfw.h"
"src/libs/imgui/imgui_impl_opengl3.cpp"
"src/libs/imgui/imgui_impl_opengl3.h"
"src/libs/imgui/imgui_internal.h"
"src/libs/imgui/imgui_widgets.cpp"
"src/libs/imgui/imstb_rectpack.h"
"src/libs/imgui/imstb_textedit.h"
"src/libs/imgui/imstb_truetype.h"
"src/libs/lodepng/lodepng.h"
"src/libs/lodepng/lodepng.cpp"
"src/libs/stb_image/stb_image.h"
"src/libs/stb_image/stb_image_resize.h"
"src/libs/stb_image_write/stb_image_write.h"
${GlmSources}
)
set(Sources
"src/helpers/MeshUtilities.cpp"
"src/helpers/MeshUtilities.h"
"src/helpers/ProgramUtilities.cpp"
"src/helpers/ProgramUtilities.h"
"src/helpers/ResourcesManager.cpp"
"src/helpers/ResourcesManager.h"
"src/libmidi/Midi.cpp"
"src/libmidi/Midi.h"
"src/libmidi/MidiEvent.cpp"
"src/libmidi/MidiEvent.h"
"src/libmidi/MidiTrack.cpp"
"src/libmidi/MidiTrack.h"
"src/libmidi/MidiTypes.h"
"src/libmidi/MidiUtil.cpp"
"src/libmidi/MidiUtil.h"
"src/libmidi/Note.h"
"src/rendering/Score.cpp"
"src/rendering/Score.h"
"src/rendering/Framebuffer.cpp"
"src/rendering/Framebuffer.h"
"src/rendering/MIDIScene.cpp"
"src/rendering/MIDIScene.h"
"src/rendering/Renderer.cpp"
"src/rendering/Renderer.h"
"src/rendering/ScreenQuad.cpp"
"src/rendering/ScreenQuad.h"
"src/rendering/State.cpp"
"src/rendering/State.h"
"src/rendering/camera/Camera.cpp"
"src/rendering/camera/Camera.h"
"src/rendering/camera/Keyboard.cpp"
"src/rendering/camera/Keyboard.h"
"src/resources/data.h"
"src/resources/flash_image.cpp"
"src/resources/font_image.cpp"
"src/resources/particles_image.cpp"
"src/resources/shaders.cpp"
"src/main.cpp")
file(GLOB Shaders "resources/shaders/*.vert" "resources/shaders/*.frag")
source_group(TREE ${PROJECT_SOURCE_DIR}/src FILES ${Sources} ${LibSources})
source_group(TREE ${PROJECT_SOURCE_DIR}/resources FILES ${Shaders})
include_directories(src/libs/)
include_directories(src/helpers/)
add_executable(MIDIVisualizer ${LibSources} ${Sources} ${Shaders})
target_link_libraries(MIDIVisualizer nfd glfw ${GLFW_LIBRARIES} ${OPENGL_gl_LIBRARY})
add_dependencies(MIDIVisualizer Packaging)