-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (49 loc) · 1.63 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
cmake_minimum_required(VERSION 3.17)
project(Blatt11_Aufgabe29)
# Set the C++ version
set(CMAKE_CXX_STANDARD 17)
# Set the build directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build/)
# Set the path for cmake to look for modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
# OpenGL
find_package(OpenGL REQUIRED)
# GLFW
if (WIN32)
# Include it only, when compiling on windows
set(GLFW3_ROOT "${PROJECT_SOURCE_DIR}/GLFW")
elseif(APPLE)
message(FATAL_ERROR "Compilation not setup for Apple systems.")
endif ()
find_package(GLFW3 REQUIRED)
# GLAD
set(GLAD_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/GLAD/include")
set(GLAD_SOURCES ${PROJECT_SOURCE_DIR}/GLAD/src/glad.c)
add_library(glad ${GLAD_SOURCES})
# ImGUI
set(IMGUI_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/ImGUI")
set(IMGUI ImGUI/imconfig.h
ImGUI/imgui.cpp
ImGUI/imgui.h
ImGUI/imgui_draw.cpp
ImGUI/imgui_impl_glfw.cpp
ImGUI/imgui_impl_glfw.h
ImGUI/imgui_impl_opengl3.cpp
ImGUI/imgui_impl_opengl3.h
ImGUI/imgui_internal.h
ImGUI/imgui_widgets.cpp
ImGUI/imstb_rectpack.h
ImGUI/imstb_textedit.h
ImGUI/imstb_truetype.h)
# Include required directories
include_directories(${GLFW3_INCLUDE_DIR} ${GLAD_INCLUDE_DIR} ${IMGUI_INCLUDE_DIR})
# Define sources
set(SOURCE src/main.cpp
src/Game.cpp
src/Game.h
src/Scene.h
src/scenes/KochCurveScene.cpp
src/scenes/KochCurveScene.h)
add_executable(Blatt11_Aufgabe29 ${SOURCE} ${IMGUI})
# Link libraries
target_link_libraries(Blatt11_Aufgabe29 ${OPENGL_LIBRARIES} glad ${GLFW3_LIBRARY} ${CMAKE_DL_LIBS})