forked from studiocentauri/graphics-and-shaders-22
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
79 lines (65 loc) · 1.94 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
75
76
77
78
79
cmake_minimum_required(VERSION "3.16.3")
project(graphics-and-shaders)
set(CMAKE_CXX_STANDARD 17)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}/std:c++17")
endif(MSVC)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
find_package(OpenGL REQUIRED)
find_package(GLFW3 REQUIRED)
find_package(ASSIMP REQUIRED)
if(ASSIMP_FOUND)
include_directories(${ASSIMP_INCLUDE_DIR})
endif(ASSIMP_FOUND)
include_directories(includes)
include_directories(includes/thirdparty)
include_directories(configuration)
configure_file(configuration/root_directory.h.in configuration/root_directory.h)
include_directories(${CMAKE_BINARY_DIR}/configuration)
if(WIN32)
link_directories(lib)
endif()
add_executable(
graphics-and-shaders
src/Main.cpp
# src/ShaderToy.cpp
src/thirdparty/glad.c
src/thirdparty/stb_image.cpp
src/rendering/Camera.cpp
src/rendering/Renderer.cpp
src/rendering/Shader.cpp
src/rendering/Texture.cpp
src/utility/FileSystem.cpp
src/object/Transform.cpp
src/object/Actor.cpp
src/object/Mesh.cpp
src/object/Model.cpp
src/gui/GUI.cpp
src/gui/Widgets.cpp
includes/thirdparty/imgui/imgui.cpp
includes/thirdparty/imgui/imgui_draw.cpp
includes/thirdparty/imgui/imgui_demo.cpp
includes/thirdparty/imgui/imgui_widgets.cpp
includes/thirdparty/imgui/imgui_tables.cpp
includes/thirdparty/imgui/imgui_impl_glfw.cpp
includes/thirdparty/imgui/imgui_impl_opengl3.cpp
)
target_link_libraries(
graphics-and-shaders ${CMAKE_DL_LIBS}
)
if(WIN32)
target_link_libraries(
graphics-and-shaders
${glfw_LIBRARIES}
)
target_link_libraries(graphics-and-shaders glfw3)
else()
target_link_libraries(graphics-and-shaders glfw)
endif()
target_link_libraries(graphics-and-shaders assimp)
if(WIN32)
add_custom_command(TARGET graphics-and-shaders POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/dll/assimp-vc142-mtd.dll"
$<TARGET_FILE_DIR:graphics-and-shaders>
)
endif(WIN32)