-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (45 loc) · 1.47 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
cmake_minimum_required(VERSION 3.16)
#SET(CMAKE_TOOLCHAIN_FILE D:/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE STRING "")
include(env.cmake)
project(opengl_tutorial)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
#如果find 失败,删除cmake-build-debug,重新reload cmake
find_package(glfw3 REQUIRED)
find_package(GLEW REQUIRED)
find_package(glm REQUIRED)
find_package(assimp REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(SHADER_SRCS
shader/ShaderLoader.h
shader/ShaderLoader.cpp
shader/ShaderProgram.h
)
set(RENDERER_INCS
renderer/IRenderer.h
renderer/Sprite.h
renderer/Director.h
renderer/MultiBars.h
renderer/Cube.h
renderer/model/Vertex.h
renderer/model/Model.h
renderer/model/Mesh.h
renderer/model/Texture.h
renderer/model/TextureLoader.h
)
aux_source_directory(renderer RENDERER_SRCS)
aux_source_directory(renderer/model RENDERER_MODEL_SRCS)
add_executable(opengl_tutorial
main.cpp
gl_func_adapter.h
InputProcessor.cpp
InputProcessor.h
${SHADER_SRCS}
${RENDERER_SRCS}
${RENDERER_INCS}
${RENDERER_MODEL_SRCS})
target_link_libraries(opengl_tutorial PRIVATE glfw)
target_link_libraries(opengl_tutorial PRIVATE GLEW::GLEW)
target_link_libraries(opengl_tutorial PRIVATE glm::glm)
target_link_libraries(opengl_tutorial PRIVATE assimp::assimp)