-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
108 lines (90 loc) · 3.09 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
cmake_minimum_required(VERSION 3.14)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(RenderIt)
option(RENDERIT_EXAMPLES_PERSONAL "Build the Personal RenderIt examples" ON)
option(RENDERIT_EXAMPLES_GPUGems "Build the GPU Gems RenderIt examples" ON)
add_definitions(-DUNICODE)
add_definitions(-DGLEW_STATIC)
find_package(OpenGL REQUIRED)
find_package(Threads REQUIRED)
option(BUILD_SHARED_LIBS "Build package with shared libraries." OFF)
option(glew-cmake_BUILD_SHARED "Build the shared glew library" OFF)
add_subdirectory(${CMAKE_SOURCE_DIR}/External/glew-cmake EXCLUDE_FROM_ALL)
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF)
option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF)
option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF)
option(GLFW_INSTALL "Generate installation target" OFF)
add_subdirectory(${CMAKE_SOURCE_DIR}/External/glfw EXCLUDE_FROM_ALL)
option(ASSIMP_BUILD_ASSIMP_TOOLS
"If the supplementary tools for Assimp are built in addition to the library."
OFF
)
option(ASSIMP_BUILD_TESTS
"If the test suite for Assimp is built in addition to the library."
OFF
)
option(ASSIMP_INSTALL
"Disable this if you want to use assimp as a submodule."
OFF
)
OPTION(ASSIMP_BUILD_ZLIB
"Build your own zlib"
ON
)
add_subdirectory(${CMAKE_SOURCE_DIR}/External/assimp EXCLUDE_FROM_ALL)
option(OPTICK_INSTALL_TARGETS "Should optick be installed? Set to OFF if you use add_subdirectory to include Optick." OFF)
add_subdirectory(${CMAKE_SOURCE_DIR}/External/optick)
file(GLOB IMGUI_SRC
${CMAKE_SOURCE_DIR}/External/imgui/*.cpp
${CMAKE_SOURCE_DIR}/External/imgui/*.h
${CMAKE_SOURCE_DIR}/External/imgui/backends/imgui_impl_opengl3.h
${CMAKE_SOURCE_DIR}/External/imgui/backends/imgui_impl_opengl3.cpp
${CMAKE_SOURCE_DIR}/External/imgui/backends/imgui_impl_glfw.h
${CMAKE_SOURCE_DIR}/External/imgui/backends/imgui_impl_glfw.cpp
)
add_library(ImGui ${IMGUI_SRC})
target_include_directories(ImGui PRIVATE
${CMAKE_SOURCE_DIR}/External/glew-cmake/include
${CMAKE_SOURCE_DIR}/External/glfw/include
${CMAKE_SOURCE_DIR}/External/imgui
${CMAKE_SOURCE_DIR}/External/imgui/backends
)
add_subdirectory(Base)
set(RENDERIT_HEADERS
${CMAKE_SOURCE_DIR}/External/glew-cmake/include
${CMAKE_SOURCE_DIR}/External/glfw/include
${CMAKE_SOURCE_DIR}/External/imgui
${CMAKE_SOURCE_DIR}/External/imgui/backends
${CMAKE_SOURCE_DIR}/External/glm
${CMAKE_SOURCE_DIR}/External/assimp/include
${CMAKE_SOURCE_DIR}/External/termcolor/include
${CMAKE_SOURCE_DIR}/External/stb
${CMAKE_SOURCE_DIR}/Base
)
set(RENDERIT_LIBS
libglew_static
glfw
assimp
ImGui
OpenGL::GL
Threads::Threads
RenderItLib
)
if(WIN32)
set(RENDERIT_LIBS
${RENDERIT_LIBS}
OptickCore
)
set(RENDERIT_HEADERS
${RENDERIT_HEADERS}
${CMAKE_SOURCE_DIR}/External/optick/src
)
endif()
if(RENDERIT_EXAMPLES_PERSONAL)
add_subdirectory(Examples/Personal)
endif(RENDERIT_EXAMPLES_PERSONAL)
if(RENDERIT_EXAMPLES_GPUGems)
add_subdirectory(Examples/GPUGems)
endif(RENDERIT_EXAMPLES_GPUGems)