-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (46 loc) · 1.49 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
#######################################
# GPU Particles example CMakeLists file
# for generating project solutions.
#
# (c) 2020 Damian Nowakowski
#######################################
cmake_minimum_required(VERSION 3.0.0)
project(Particles VERSION 1.0.0)
# It requires OpenGL
find_package(OpenGL REQUIRED)
# Search for GLFW includes and lib
set (GLFW_INCLUDE_DIR "" CACHE PATH "Libs")
set (GLFW_LIB "" CACHE FILEPATH "Libs")
# Search for GLEW includes and lib
set (GLEW_INCLUDE_DIR "" CACHE PATH "Libs")
set (GLEW_LIB "" CACHE FILEPATH "Libs")
# Search for all sources
set (SRC_FILES Src/Main.cpp)
set (SRC_FILES ${SRC_FILES}
Src/Camera.cpp
Src/Engine.cpp
Src/Particles.cpp
Src/Scene.cpp
Src/Shaders.cpp
Src/Window.cpp)
set (SRC_FILES ${SRC_FILES}
ExternalSrc/inih/ini.c
ExternalSrc/inih/cpp/INIReader.cpp)
# Search and setup all includes
set (INCLUDE_DIRS ExternalSrc ${GLEW_INCLUDE_DIR} ${GLFW_INCLUDE_DIR})
include_directories (${INCLUDE_DIRS})
# Setup GLFW library
add_library (GlfwLibrary IMPORTED STATIC GLOBAL)
set_target_properties (GlfwLibrary PROPERTIES
IMPORTED_LOCATION ${GLFW_LIB}
)
# Setup GLEW library
add_library (GlewLibrary IMPORTED STATIC GLOBAL)
set_target_properties (GlewLibrary PROPERTIES
IMPORTED_LOCATION ${GLEW_LIB}
)
# Setup output path
set (EXECUTABLE_OUTPUT_PATH ../Output)
# Setup executable and link with libraries
add_executable (Particles ${SRC_FILES})
target_link_libraries (Particles ${OPENGL_LIBRARIES} GlewLibrary GlfwLibrary)