-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
40 lines (30 loc) · 873 Bytes
/
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
cmake_minimum_required(VERSION 3.0)
project(opengl-experiments)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Variables
set(EXTERNAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external")
set(PROJECT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
# OpenGL
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
# GLFW
option(GLFW_BUILD_DOCS OFF)
option(GLFW_BUILD_EXAMPLES OFF)
option(GLFW_BUILD_TESTS OFF)
option(GLFW_INSTALL OFF)
# External dependencies (GLFW, GLAD, etc)
add_subdirectory(external)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include/
${EXTERNAL_DIR}/glfw/include/
${EXTERNAL_DIR}/glad/include/
)
set(ALL_LIBS
${OPENGL_LIBRARY}
glfw
glad
)
# define the SHADER_DIR macro that points to the full path to
# the src/shaders folder
add_compile_definitions(SHADER_DIR="${PROJECT_SOURCE_DIR}/src/shaders")
add_subdirectory(src)