-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (64 loc) · 1.27 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.0)
project(fractals)
# Directories
set(IMGUI_SRC_DIR libs/imgui)
set(LIB_SFML_PATH libs/sfml)
set(LIB_DIR libs)
set(INCLUDE_DIR includes)
set(SRC_DIR src)
# Load OpenGL
set(OpenGL_GL_PREFERENCE "GLVND")
find_package(OpenGL REQUIRED)
# Load SFML
find_package(
SFML 2.5.1 COMPONENTS REQUIRED
system
window
graphics
PATHS ${LIB_SFML_PATH}
)
# Load source and header files
set(SOURCES ${SRC_DIR}/main.cpp)
set(HEADERS)
# Load ImGUI src files
set(
IMGUI_LIB_SRC
${IMGUI_SRC_DIR}/imgui.cpp
${IMGUI_SRC_DIR}/imgui_draw.cpp
${IMGUI_SRC_DIR}/imgui_tables.cpp
${IMGUI_SRC_DIR}/imgui_widgets.cpp
${IMGUI_SRC_DIR}/imgui-SFML.cpp
)
# Load GLAD and STB src files
set(
LIBS_SRC
${LIB_DIR}/glad/src/glad.c
)
# Include directories
include_directories(
${LIB_DIR}
${INCLUDE_DIR}
${LIB_DIR}/glad/include
)
# Executable
add_executable(
${CMAKE_PROJECT_NAME}
${SOURCES}
${HEADERS}
${LIBS_SRC}
${IMGUI_LIB_SRC}
)
# Include directory to target
target_include_directories(
${CMAKE_PROJECT_NAME} PRIVATE
${IMGUI_SRC_DIR}
)
# Link libraries to target
target_link_libraries(
${CMAKE_PROJECT_NAME} PRIVATE
sfml-system
sfml-window
sfml-graphics
dl
${OPENGL_LIBRARY}
)