-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (45 loc) · 1.08 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
cmake_minimum_required(VERSION 3.20.0)
project(opengl VERSION 0.1.0)
# include()
set(CMAKE_CXX_STANDARD 20)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wshadow")
include(CPack)
if($ENV{XDG_SESSION_TYPE} STREQUAL "wayland")
set(GLFW_USE_WAYLAND 1)
endif()
# include(CheckIncludeFile)
# include(CheckIncludeFileCXX)
# include(CheckIncludeFiles)
# include(ExternalProject)
# include(libs/glew.cmake)
add_subdirectory(libs)
include_directories(
include
vendor/glew_2.2/include
)
link_directories(
vendor/glew_2.2/lib
)
set(RENDERER_FILES
src/Renderer/Buffer.cpp
src/Renderer/IndexBuffer.cpp
src/Renderer/OpenGLIndexBuffer.cpp
src/Renderer/OpenGLVertexBuffer.cpp
src/Renderer/Renderer.cpp
src/Renderer/VertexBuffer.cpp
)
add_library(renderer SHARED ${RENDERER_FILES})
target_link_libraries(renderer
GLEW
)
add_executable(${CMAKE_PROJECT_NAME} src/main.cpp)
target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC
renderer
glfw
GL
GLEW
)
enable_testing()
add_subdirectory(tests)