Added 'Diligent-' prefix to project names to avoid name conflicts (https://github.com/DiligentGraphics/DiligentEngine/issues/20)
Egor Yusov
3 years ago
1 | 1 | |
2 | 2 | function(copy_required_dlls TARGET_NAME) |
3 | 3 | if(D3D11_SUPPORTED) |
4 | list(APPEND ENGINE_DLLS GraphicsEngineD3D11-shared) | |
4 | list(APPEND ENGINE_DLLS Diligent-GraphicsEngineD3D11-shared) | |
5 | 5 | endif() |
6 | 6 | if(D3D12_SUPPORTED) |
7 | list(APPEND ENGINE_DLLS GraphicsEngineD3D12-shared) | |
7 | list(APPEND ENGINE_DLLS Diligent-GraphicsEngineD3D12-shared) | |
8 | 8 | endif() |
9 | 9 | if(GL_SUPPORTED) |
10 | list(APPEND ENGINE_DLLS GraphicsEngineOpenGL-shared) | |
10 | list(APPEND ENGINE_DLLS Diligent-GraphicsEngineOpenGL-shared) | |
11 | 11 | endif() |
12 | 12 | if(VULKAN_SUPPORTED) |
13 | list(APPEND ENGINE_DLLS GraphicsEngineVk-shared) | |
13 | list(APPEND ENGINE_DLLS Diligent-GraphicsEngineVk-shared) | |
14 | endif() | |
15 | if(METAL_SUPPORTED) | |
16 | list(APPEND ENGINE_DLLS Diligent-GraphicsEngineMetal-shared) | |
14 | 17 | endif() |
15 | 18 | |
16 | 19 | foreach(DLL ${ENGINE_DLLS}) |
175 | 178 | endif() |
176 | 179 | |
177 | 180 | if(D3D11_SUPPORTED) |
178 | list(APPEND BACKENDS GraphicsEngineD3D11-${LIB_TYPE}) | |
181 | list(APPEND BACKENDS Diligent-GraphicsEngineD3D11-${LIB_TYPE}) | |
179 | 182 | endif() |
180 | 183 | if(D3D12_SUPPORTED) |
181 | list(APPEND BACKENDS GraphicsEngineD3D12-${LIB_TYPE}) | |
184 | list(APPEND BACKENDS Diligent-GraphicsEngineD3D12-${LIB_TYPE}) | |
182 | 185 | endif() |
183 | 186 | if(GL_SUPPORTED OR GLES_SUPPORTED) |
184 | list(APPEND BACKENDS GraphicsEngineOpenGL-${LIB_TYPE}) | |
187 | list(APPEND BACKENDS Diligent-GraphicsEngineOpenGL-${LIB_TYPE}) | |
185 | 188 | endif() |
186 | 189 | if(VULKAN_SUPPORTED) |
187 | list(APPEND BACKENDS GraphicsEngineVk-${LIB_TYPE}) | |
190 | list(APPEND BACKENDS Diligent-GraphicsEngineVk-${LIB_TYPE}) | |
188 | 191 | endif() |
189 | 192 | if(METAL_SUPPORTED) |
190 | list(APPEND BACKENDS GraphicsEngineMetal-${LIB_TYPE}) | |
193 | list(APPEND BACKENDS Diligent-GraphicsEngineMetal-${LIB_TYPE}) | |
191 | 194 | endif() |
192 | 195 | # ${_TARGETS} == ENGINE_LIBRARIES |
193 | 196 | # ${${_TARGETS}} == ${ENGINE_LIBRARIES} |
198 | 201 | # Returns path to the library relative to the DiligentCore root |
199 | 202 | function(get_core_library_relative_dir _TARGET _DIR) |
200 | 203 | # Use the directory of Primitives (the first target processed) as reference |
201 | get_target_property(PRIMITIVES_SOURCE_DIR Primitives SOURCE_DIR) | |
204 | get_target_property(PRIMITIVES_SOURCE_DIR Diligent-Primitives SOURCE_DIR) | |
202 | 205 | get_target_property(TARGET_SOURCE_DIR ${_TARGET} SOURCE_DIR) |
203 | 206 | file(RELATIVE_PATH TARGET_RELATIVE_PATH "${PRIMITIVES_SOURCE_DIR}/.." "${TARGET_SOURCE_DIR}") |
204 | 207 | set(${_DIR} ${TARGET_RELATIVE_PATH} PARENT_SCOPE) |
65 | 65 | endif() |
66 | 66 | endif(WIN32) |
67 | 67 | |
68 | add_library(BuildSettings INTERFACE) | |
68 | add_library(Diligent-BuildSettings INTERFACE) | |
69 | 69 | |
70 | 70 | if(PLATFORM_WIN32) |
71 | 71 | if(MSVC) |
84 | 84 | if(${ARCH} EQUAL 64) |
85 | 85 | set(VULKAN_SUPPORTED TRUE CACHE INTERNAL "Vulkan is supported on Win64 platform") |
86 | 86 | endif() |
87 | target_compile_definitions(BuildSettings INTERFACE PLATFORM_WIN32=1) | |
87 | target_compile_definitions(Diligent-BuildSettings INTERFACE PLATFORM_WIN32=1) | |
88 | 88 | elseif(PLATFORM_UNIVERSAL_WINDOWS) |
89 | 89 | set(D3D11_SUPPORTED TRUE CACHE INTERNAL "D3D11 is supported on Univeral Windows platform") |
90 | 90 | if(NOT CMAKE_SYSTEM_VERSION STREQUAL "8.1") |
91 | 91 | set(D3D12_SUPPORTED TRUE CACHE INTERNAL "D3D12 is supported on Univeral Windows platform") |
92 | 92 | endif() |
93 | target_compile_definitions(BuildSettings INTERFACE PLATFORM_UNIVERSAL_WINDOWS=1) | |
93 | target_compile_definitions(Diligent-BuildSettings INTERFACE PLATFORM_UNIVERSAL_WINDOWS=1) | |
94 | 94 | elseif(PLATFORM_ANDROID) |
95 | 95 | set(GLES_SUPPORTED TRUE CACHE INTERNAL "OpenGLES is supported on Android platform") |
96 | 96 | string(REGEX MATCH [0-9]+ ANDROID_API_LEVEL ${ANDROID_PLATFORM}) |
97 | 97 | if(${ARCH} EQUAL 64 AND ${ANDROID_API_LEVEL} GREATER 23) |
98 | 98 | set(VULKAN_SUPPORTED TRUE CACHE INTERNAL "Vulkan is supported on Android platform") |
99 | 99 | endif() |
100 | target_compile_definitions(BuildSettings INTERFACE PLATFORM_ANDROID=1) | |
100 | target_compile_definitions(Diligent-BuildSettings INTERFACE PLATFORM_ANDROID=1) | |
101 | 101 | elseif(PLATFORM_LINUX) |
102 | 102 | set(GL_SUPPORTED TRUE CACHE INTERNAL "OpenGL is supported on Linux platform") |
103 | 103 | if(${ARCH} EQUAL 64) |
104 | 104 | set(VULKAN_SUPPORTED TRUE CACHE INTERNAL "Vulkan is supported on Linux64 platform") |
105 | 105 | endif() |
106 | target_compile_definitions(BuildSettings INTERFACE PLATFORM_LINUX=1) | |
106 | target_compile_definitions(Diligent-BuildSettings INTERFACE PLATFORM_LINUX=1) | |
107 | 107 | elseif(PLATFORM_MACOS) |
108 | 108 | set(GL_SUPPORTED TRUE CACHE INTERNAL "OpenGL is supported on MacOS platform") |
109 | 109 | set(METAL_SUPPORTED TRUE CACHE INTERNAL "Metal is supported on MacOS platform") |
110 | 110 | set(VULKAN_SUPPORTED TRUE CACHE INTERNAL "Vulkan is enabled through MoltenVK on MacOS platform") |
111 | target_compile_definitions(BuildSettings INTERFACE PLATFORM_MACOS=1) | |
111 | target_compile_definitions(Diligent-BuildSettings INTERFACE PLATFORM_MACOS=1) | |
112 | 112 | elseif(PLATFORM_IOS) |
113 | 113 | set(GLES_SUPPORTED TRUE CACHE INTERNAL "OpenGLES is supported on iOS platform") |
114 | 114 | set(METAL_SUPPORTED TRUE CACHE INTERNAL "Metal is supported on iOS platform") |
126 | 126 | else() |
127 | 127 | message("VULKAN_SDK is undefined. Vulkan backend will be disabled.") |
128 | 128 | endif() |
129 | target_compile_definitions(BuildSettings INTERFACE PLATFORM_IOS=1) | |
129 | target_compile_definitions(Diligent-BuildSettings INTERFACE PLATFORM_IOS=1) | |
130 | 130 | else() |
131 | 131 | message(FATAL_ERROR "No PLATFORM_XXX variable defined. Make sure that 'DiligentCore' folder is processed first") |
132 | 132 | endif() |
166 | 166 | message("VULKAN_SUPPORTED: " ${VULKAN_SUPPORTED}) |
167 | 167 | message("METAL_SUPPORTED: " ${METAL_SUPPORTED}) |
168 | 168 | |
169 | target_compile_definitions(BuildSettings | |
169 | target_compile_definitions(Diligent-BuildSettings | |
170 | 170 | INTERFACE |
171 | 171 | D3D11_SUPPORTED=$<BOOL:${D3D11_SUPPORTED}> |
172 | 172 | D3D12_SUPPORTED=$<BOOL:${D3D12_SUPPORTED}> |
181 | 181 | # For msvc, enable level 4 warnings except for |
182 | 182 | # - w4100 - unreferenced formal parameter |
183 | 183 | # - w4505 - unreferenced local function has been removed |
184 | target_compile_options(BuildSettings INTERFACE /W4 /wd4100 /wd4505) | |
184 | target_compile_options(Diligent-BuildSettings INTERFACE /W4 /wd4100 /wd4505) | |
185 | 185 | # In all release modes also: |
186 | 186 | # - disable w4189 - local variable is initialized but not referenced |
187 | 187 | # - Enable AVX2 instruction set (/arch:AVX2) |
189 | 189 | # - Enable whole program optimization (/GL) |
190 | 190 | # - Enable string pooling (/GF) |
191 | 191 | set(MSVC_ALL_RELEASE_COMPILE_OPTIONS /arch:AVX2 /wd4189 /GR- /GL /GF) |
192 | #target_compile_options(BuildSettings INTERFACE "$<$<CONFIG:RELEASE>:/arch:AVX2 /wd4189 /Ot") | |
192 | #target_compile_options(Diligent-BuildSettings INTERFACE "$<$<CONFIG:RELEASE>:/arch:AVX2 /wd4189 /Ot") | |
193 | 193 | # In RELEASE mode: |
194 | 194 | # - Set favor fast code option (/Ot) |
195 | 195 | # - Enable intrinsic functions (/Oi) |
198 | 198 | # In MINSIZEREL mode set favor small code option (/Os) |
199 | 199 | set(MSVC_MINSIZEREL_COMPILE_OPTIONS ${MSVC_ALL_RELEASE_COMPILE_OPTIONS} /Os) |
200 | 200 | set(MSVC_RELWITHDEBINFO_COMPILE_OPTIONS ${MSVC_ALL_RELEASE_COMPILE_OPTIONS} /Ot /Oi /Ob2 /Ox) |
201 | target_compile_options(BuildSettings INTERFACE "$<$<CONFIG:RELEASE>:${MSVC_RELEASE_COMPILE_OPTIONS}>") | |
202 | target_compile_options(BuildSettings INTERFACE "$<$<CONFIG:MINSIZEREL>:${MSVC_MINSIZEREL_COMPILE_OPTIONS}>") | |
203 | target_compile_options(BuildSettings INTERFACE "$<$<CONFIG:RELWITHDEBINFO>:${MSVC_RELWITHDEBINFO_COMPILE_OPTIONS}>") | |
201 | target_compile_options(Diligent-BuildSettings INTERFACE "$<$<CONFIG:RELEASE>:${MSVC_RELEASE_COMPILE_OPTIONS}>") | |
202 | target_compile_options(Diligent-BuildSettings INTERFACE "$<$<CONFIG:MINSIZEREL>:${MSVC_MINSIZEREL_COMPILE_OPTIONS}>") | |
203 | target_compile_options(Diligent-BuildSettings INTERFACE "$<$<CONFIG:RELWITHDEBINFO>:${MSVC_RELWITHDEBINFO_COMPILE_OPTIONS}>") | |
204 | 204 | # !!!NOTE!!! For some reason above is the only form of generator expression that works |
205 | 205 | # For instance, this way |
206 | # target_compile_options(BuildSettings INTERFACE "$<$<CONFIG:RELEASE>:/Ot>") | |
206 | # target_compile_options(Diligent-BuildSettings INTERFACE "$<$<CONFIG:RELEASE>:/Ot>") | |
207 | 207 | # does not work as expected |
208 | 208 | |
209 | 209 | set(DEBUG_MACROS DEVELOPMENT) |
210 | target_compile_definitions(BuildSettings INTERFACE "$<$<CONFIG:DEBUG>:${DEBUG_MACROS}>") | |
210 | target_compile_definitions(Diligent-BuildSettings INTERFACE "$<$<CONFIG:DEBUG>:${DEBUG_MACROS}>") | |
211 | 211 | else() |
212 | 212 | |
213 | 213 | set(DEBUG_MACROS _DEBUG DEBUG DEVELOPMENT) |
214 | 214 | set(RELEASE_MACROS NDEBUG) |
215 | 215 | |
216 | 216 | foreach(DBG_CONFIG ${DEBUG_CONFIGURATIONS}) |
217 | target_compile_definitions(BuildSettings INTERFACE "$<$<CONFIG:${DBG_CONFIG}>:${DEBUG_MACROS}>") | |
217 | target_compile_definitions(Diligent-BuildSettings INTERFACE "$<$<CONFIG:${DBG_CONFIG}>:${DEBUG_MACROS}>") | |
218 | 218 | endforeach() |
219 | 219 | |
220 | 220 | foreach(REL_CONFIG ${RELEASE_CONFIGURATIONS}) |
221 | target_compile_definitions(BuildSettings INTERFACE "$<$<CONFIG:${REL_CONFIG}>:${RELEASE_MACROS}>") | |
221 | target_compile_definitions(Diligent-BuildSettings INTERFACE "$<$<CONFIG:${REL_CONFIG}>:${RELEASE_MACROS}>") | |
222 | 222 | endforeach() |
223 | 223 | |
224 | 224 | endif(MSVC) |
350 | 350 | DESTINATION "${DILIGENT_CORE_INSTALL_DIR}/lib/" |
351 | 351 | ) |
352 | 352 | set_target_properties(DiligentCore-static PROPERTIES |
353 | FOLDER Core | |
353 | FOLDER DiligentCore | |
354 | 354 | ) |
355 | 355 | else() |
356 | 356 | message("Unable to find librarian tool. Combined DiligentCore static library will not be produced.") |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(Common CXX) | |
2 | project(Diligent-Common CXX) | |
3 | 3 | |
4 | 4 | set(INCLUDE |
5 | 5 | include/pch.h |
40 | 40 | src/Timer.cpp |
41 | 41 | ) |
42 | 42 | |
43 | add_library(Common STATIC ${SOURCE} ${INCLUDE} ${INTERFACE}) | |
43 | add_library(Diligent-Common STATIC ${SOURCE} ${INCLUDE} ${INTERFACE}) | |
44 | 44 | |
45 | target_include_directories(Common | |
45 | target_include_directories(Diligent-Common | |
46 | 46 | PRIVATE |
47 | 47 | include |
48 | 48 | PUBLIC |
49 | 49 | interface |
50 | 50 | ) |
51 | 51 | |
52 | target_link_libraries(Common | |
52 | target_link_libraries(Diligent-Common | |
53 | 53 | PUBLIC |
54 | BuildSettings | |
55 | TargetPlatform | |
54 | Diligent-BuildSettings | |
55 | Diligent-TargetPlatform | |
56 | 56 | ) |
57 | set_common_target_properties(Common) | |
57 | set_common_target_properties(Diligent-Common) | |
58 | 58 | |
59 | 59 | source_group("src" FILES ${SOURCE}) |
60 | 60 | source_group("include" FILES ${INCLUDE}) |
61 | 61 | source_group("interface" FILES ${INTERFACE}) |
62 | 62 | |
63 | set_target_properties(Common PROPERTIES | |
64 | FOLDER Core | |
63 | set_target_properties(Diligent-Common PROPERTIES | |
64 | FOLDER DiligentCore | |
65 | 65 | ) |
66 | 66 | |
67 | 67 | if(INSTALL_DILIGENT_CORE) |
68 | install_core_lib(Common) | |
68 | install_core_lib(Diligent-Common) | |
69 | 69 | endif() |
24 | 24 | include |
25 | 25 | ) |
26 | 26 | |
27 | target_link_libraries(glew-static PRIVATE BuildSettings) | |
27 | target_link_libraries(glew-static PRIVATE Diligent-BuildSettings) | |
28 | 28 | |
29 | 29 | if(MSVC) |
30 | 30 | target_compile_options(glew-static PRIVATE /wd4456) |
34 | 34 | source_group("include" FILES ${INCLUDE}) |
35 | 35 | |
36 | 36 | set_target_properties(glew-static PROPERTIES |
37 | FOLDER Core/External | |
37 | FOLDER DiligentCore/External | |
38 | 38 | ) |
2 | 2 | set(DLL_REL_SUFFIX _${ARCH}r) |
3 | 3 | set(DLL_DBG_SUFFIX _${ARCH}d) |
4 | 4 | |
5 | add_library(GraphicsEngineInterface INTERFACE) | |
6 | target_include_directories(GraphicsEngineInterface | |
5 | add_library(Diligent-GraphicsEngineInterface INTERFACE) | |
6 | target_include_directories(Diligent-GraphicsEngineInterface | |
7 | 7 | INTERFACE |
8 | 8 | GraphicsEngine/interface |
9 | 9 | ) |
10 | target_link_libraries(GraphicsEngineInterface | |
10 | target_link_libraries(Diligent-GraphicsEngineInterface | |
11 | 11 | INTERFACE |
12 | Primitives | |
12 | Diligent-Primitives | |
13 | 13 | ) |
14 | 14 | |
15 | 15 | add_subdirectory(GraphicsAccessories) |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(GLSLTools CXX) | |
2 | project(Diligent-GLSLTools CXX) | |
3 | 3 | |
4 | 4 | set(INCLUDE |
5 | 5 | include/GLSLSourceBuilder.h |
27 | 27 | endif() |
28 | 28 | endif() |
29 | 29 | |
30 | add_library(GLSLTools STATIC ${SOURCE} ${INCLUDE}) | |
30 | add_library(Diligent-GLSLTools STATIC ${SOURCE} ${INCLUDE}) | |
31 | 31 | |
32 | target_include_directories(GLSLTools | |
32 | target_include_directories(Diligent-GLSLTools | |
33 | 33 | PUBLIC |
34 | 34 | include |
35 | 35 | PRIVATE |
37 | 37 | ../GraphicsEngine/include |
38 | 38 | ) |
39 | 39 | |
40 | target_link_libraries(GLSLTools | |
40 | target_link_libraries(Diligent-GLSLTools | |
41 | 41 | PRIVATE |
42 | BuildSettings | |
43 | GraphicsAccessories | |
44 | Common | |
42 | Diligent-BuildSettings | |
43 | Diligent-GraphicsAccessories | |
44 | Diligent-Common | |
45 | 45 | PUBLIC |
46 | HLSL2GLSLConverterLib | |
47 | GraphicsEngineInterface | |
46 | Diligent-HLSL2GLSLConverterLib | |
47 | Diligent-GraphicsEngineInterface | |
48 | 48 | ) |
49 | 49 | |
50 | 50 | if(VULKAN_SUPPORTED) |
51 | target_link_libraries(GLSLTools | |
51 | target_link_libraries(Diligent-GLSLTools | |
52 | 52 | PRIVATE |
53 | 53 | spirv-cross-core |
54 | 54 | ) |
55 | 55 | |
56 | 56 | if (NOT ${DILIGENT_NO_GLSLANG}) |
57 | target_link_libraries(GLSLTools | |
57 | target_link_libraries(Diligent-GLSLTools | |
58 | 58 | PRIVATE |
59 | 59 | glslang |
60 | 60 | SPIRV |
61 | 61 | ) |
62 | 62 | |
63 | target_include_directories(GLSLTools | |
63 | target_include_directories(Diligent-GLSLTools | |
64 | 64 | PRIVATE |
65 | 65 | ../../External/glslang |
66 | 66 | ) |
67 | 67 | endif() |
68 | 68 | endif() |
69 | 69 | |
70 | set_common_target_properties(GLSLTools) | |
70 | set_common_target_properties(Diligent-GLSLTools) | |
71 | 71 | |
72 | 72 | source_group("src" FILES ${SOURCE}) |
73 | 73 | source_group("include" FILES ${INCLUDE}) |
74 | 74 | source_group("interface" FILES ${INTERFACE}) |
75 | 75 | |
76 | set_target_properties(GLSLTools PROPERTIES | |
77 | FOLDER Core/Graphics | |
76 | set_target_properties(Diligent-GLSLTools PROPERTIES | |
77 | FOLDER DiligentCore/Graphics | |
78 | 78 | ) |
79 | 79 | |
80 | 80 | if(INSTALL_DILIGENT_CORE) |
81 | install_core_lib(GLSLTools) | |
81 | install_core_lib(Diligent-GLSLTools) | |
82 | 82 | endif()⏎ |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(GraphicsAccessories CXX) | |
2 | project(Diligent-GraphicsAccessories CXX) | |
3 | 3 | |
4 | 4 | set(INTERFACE |
5 | 5 | interface/ColorConversion.h |
17 | 17 | src/GraphicsAccessories.cpp |
18 | 18 | ) |
19 | 19 | |
20 | add_library(GraphicsAccessories STATIC ${SOURCE} ${INTERFACE}) | |
20 | add_library(Diligent-GraphicsAccessories STATIC ${SOURCE} ${INTERFACE}) | |
21 | 21 | |
22 | target_include_directories(GraphicsAccessories | |
22 | target_include_directories(Diligent-GraphicsAccessories | |
23 | 23 | PUBLIC |
24 | 24 | interface |
25 | 25 | ) |
26 | 26 | |
27 | target_link_libraries(GraphicsAccessories | |
27 | target_link_libraries(Diligent-GraphicsAccessories | |
28 | 28 | PUBLIC |
29 | BuildSettings | |
30 | Common | |
31 | GraphicsEngineInterface | |
29 | Diligent-BuildSettings | |
30 | Diligent-Common | |
31 | Diligent-GraphicsEngineInterface | |
32 | 32 | ) |
33 | 33 | |
34 | set_common_target_properties(GraphicsAccessories) | |
34 | set_common_target_properties(Diligent-GraphicsAccessories) | |
35 | 35 | |
36 | 36 | source_group("src" FILES ${SOURCE}) |
37 | 37 | source_group("interface" FILES ${INTERFACE}) |
38 | 38 | |
39 | set_target_properties(GraphicsAccessories PROPERTIES | |
40 | FOLDER Core/Graphics | |
39 | set_target_properties(Diligent-GraphicsAccessories PROPERTIES | |
40 | FOLDER DiligentCore/Graphics | |
41 | 41 | ) |
42 | 42 | |
43 | 43 | if(INSTALL_DILIGENT_CORE) |
44 | install_core_lib(GraphicsAccessories) | |
44 | install_core_lib(Diligent-GraphicsAccessories) | |
45 | 45 | endif()⏎ |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(GraphicsEngine CXX) | |
2 | project(Diligent-GraphicsEngine CXX) | |
3 | 3 | |
4 | 4 | set(INCLUDE |
5 | 5 | include/BufferBase.h |
63 | 63 | src/Texture.cpp |
64 | 64 | ) |
65 | 65 | |
66 | add_library(GraphicsEngine STATIC ${SOURCE} ${INTERFACE} ${INCLUDE}) | |
67 | set_common_target_properties(GraphicsEngine) | |
66 | add_library(Diligent-GraphicsEngine STATIC ${SOURCE} ${INTERFACE} ${INCLUDE}) | |
67 | set_common_target_properties(Diligent-GraphicsEngine) | |
68 | 68 | |
69 | target_include_directories(GraphicsEngine | |
69 | target_include_directories(Diligent-GraphicsEngine | |
70 | 70 | PUBLIC |
71 | 71 | include |
72 | 72 | interface |
73 | 73 | ) |
74 | 74 | |
75 | target_link_libraries(GraphicsEngine | |
75 | target_link_libraries(Diligent-GraphicsEngine | |
76 | 76 | PUBLIC |
77 | BuildSettings | |
78 | PlatformInterface | |
79 | Common | |
80 | GraphicsAccessories | |
77 | Diligent-BuildSettings | |
78 | Diligent-PlatformInterface | |
79 | Diligent-Common | |
80 | Diligent-GraphicsAccessories | |
81 | 81 | ) |
82 | 82 | |
83 | 83 | source_group("src" FILES ${SOURCE}) |
84 | 84 | source_group("include" FILES ${INCLUDE}) |
85 | 85 | source_group("interface" FILES ${INTERFACE}) |
86 | 86 | |
87 | set_target_properties(GraphicsEngine PROPERTIES | |
88 | FOLDER Core/Graphics | |
87 | set_target_properties(Diligent-GraphicsEngine PROPERTIES | |
88 | FOLDER DiligentCore/Graphics | |
89 | 89 | ) |
90 | 90 | |
91 | 91 | if(INSTALL_DILIGENT_CORE) |
92 | install_core_lib(GraphicsEngine) | |
92 | install_core_lib(Diligent-GraphicsEngine) | |
93 | 93 | endif()⏎ |
0 | 0 | cmake_minimum_required (VERSION 3.10) |
1 | 1 | |
2 | project(GraphicsEngineD3D11 CXX) | |
2 | project(Diligent-GraphicsEngineD3D11 CXX) | |
3 | 3 | |
4 | 4 | |
5 | 5 | set(INCLUDE |
71 | 71 | src/TextureViewD3D11Impl.cpp |
72 | 72 | ) |
73 | 73 | |
74 | add_library(GraphicsEngineD3D11Interface INTERFACE) | |
75 | target_include_directories(GraphicsEngineD3D11Interface | |
74 | add_library(Diligent-GraphicsEngineD3D11Interface INTERFACE) | |
75 | target_include_directories(Diligent-GraphicsEngineD3D11Interface | |
76 | 76 | INTERFACE |
77 | 77 | interface |
78 | 78 | ) |
79 | target_link_libraries(GraphicsEngineD3D11Interface | |
79 | target_link_libraries(Diligent-GraphicsEngineD3D11Interface | |
80 | 80 | INTERFACE |
81 | GraphicsEngineD3DBaseInterface | |
81 | Diligent-GraphicsEngineD3DBaseInterface | |
82 | 82 | ) |
83 | 83 | |
84 | 84 | |
85 | add_library(GraphicsEngineD3D11-static STATIC | |
85 | add_library(Diligent-GraphicsEngineD3D11-static STATIC | |
86 | 86 | ${SRC} ${INTERFACE} ${INCLUDE} |
87 | 87 | readme.md |
88 | 88 | ) |
89 | 89 | |
90 | add_library(GraphicsEngineD3D11-shared SHARED | |
90 | add_library(Diligent-GraphicsEngineD3D11-shared SHARED | |
91 | 91 | src/DLLMain.cpp |
92 | 92 | src/GraphicsEngineD3D11.def |
93 | 93 | readme.md |
94 | 94 | ) |
95 | 95 | |
96 | 96 | # Set output name to GraphicsEngineD3D11_{32|64}{r|d} |
97 | set_dll_output_name(GraphicsEngineD3D11-shared GraphicsEngineD3D11) | |
97 | set_dll_output_name(Diligent-GraphicsEngineD3D11-shared GraphicsEngineD3D11) | |
98 | 98 | |
99 | set_common_target_properties(GraphicsEngineD3D11-shared) | |
100 | set_common_target_properties(GraphicsEngineD3D11-static) | |
99 | set_common_target_properties(Diligent-GraphicsEngineD3D11-shared) | |
100 | set_common_target_properties(Diligent-GraphicsEngineD3D11-static) | |
101 | 101 | |
102 | target_include_directories(GraphicsEngineD3D11-static | |
102 | target_include_directories(Diligent-GraphicsEngineD3D11-static | |
103 | 103 | PRIVATE |
104 | 104 | include |
105 | 105 | ) |
106 | 106 | |
107 | target_link_libraries(GraphicsEngineD3D11-static | |
107 | target_link_libraries(Diligent-GraphicsEngineD3D11-static | |
108 | 108 | PRIVATE |
109 | BuildSettings | |
110 | GraphicsEngineD3DBase | |
111 | TargetPlatform | |
112 | Common | |
109 | Diligent-BuildSettings | |
110 | Diligent-GraphicsEngineD3DBase | |
111 | Diligent-TargetPlatform | |
112 | Diligent-Common | |
113 | 113 | dxgi.lib |
114 | 114 | d3d11.lib |
115 | 115 | d3dcompiler.lib |
116 | 116 | PUBLIC |
117 | GraphicsEngineD3D11Interface | |
117 | Diligent-GraphicsEngineD3D11Interface | |
118 | 118 | ) |
119 | 119 | |
120 | target_link_libraries(GraphicsEngineD3D11-shared | |
120 | target_link_libraries(Diligent-GraphicsEngineD3D11-shared | |
121 | 121 | PRIVATE |
122 | BuildSettings | |
123 | GraphicsEngineD3D11-static | |
122 | Diligent-BuildSettings | |
123 | Diligent-GraphicsEngineD3D11-static | |
124 | 124 | PUBLIC |
125 | GraphicsEngineD3D11Interface | |
125 | Diligent-GraphicsEngineD3D11Interface | |
126 | 126 | ) |
127 | target_compile_definitions(GraphicsEngineD3D11-shared PUBLIC ENGINE_DLL=1) | |
127 | target_compile_definitions(Diligent-GraphicsEngineD3D11-shared PUBLIC ENGINE_DLL=1) | |
128 | 128 | |
129 | 129 | source_group("src" FILES ${SRC} ) |
130 | 130 | |
136 | 136 | source_group("include" FILES ${INCLUDE}) |
137 | 137 | source_group("interface" FILES ${INTERFACE}) |
138 | 138 | |
139 | set_target_properties(GraphicsEngineD3D11-static PROPERTIES | |
140 | FOLDER Core/Graphics | |
139 | set_target_properties(Diligent-GraphicsEngineD3D11-static PROPERTIES | |
140 | FOLDER DiligentCore/Graphics | |
141 | 141 | ) |
142 | set_target_properties(GraphicsEngineD3D11-shared PROPERTIES | |
143 | FOLDER Core/Graphics | |
142 | set_target_properties(Diligent-GraphicsEngineD3D11-shared PROPERTIES | |
143 | FOLDER DiligentCore/Graphics | |
144 | 144 | ) |
145 | 145 | |
146 | 146 | set_source_files_properties( |
148 | 148 | ) |
149 | 149 | |
150 | 150 | if(INSTALL_DILIGENT_CORE) |
151 | install_core_lib(GraphicsEngineD3D11-shared) | |
152 | install_core_lib(GraphicsEngineD3D11-static) | |
151 | install_core_lib(Diligent-GraphicsEngineD3D11-shared) | |
152 | install_core_lib(Diligent-GraphicsEngineD3D11-static) | |
153 | 153 | endif()⏎ |
0 | 0 | cmake_minimum_required (VERSION 3.10) |
1 | 1 | |
2 | project(GraphicsEngineD3D12 CXX) | |
2 | project(Diligent-GraphicsEngineD3D12 CXX) | |
3 | 3 | |
4 | 4 | set(INCLUDE |
5 | 5 | include/BufferD3D12Impl.h |
101 | 101 | #VS_SHADER_FLAGS "/O3" |
102 | 102 | ) |
103 | 103 | |
104 | add_library(GraphicsEngineD3D12Interface INTERFACE) | |
105 | target_include_directories(GraphicsEngineD3D12Interface | |
104 | add_library(Diligent-GraphicsEngineD3D12Interface INTERFACE) | |
105 | target_include_directories(Diligent-GraphicsEngineD3D12Interface | |
106 | 106 | INTERFACE |
107 | 107 | interface |
108 | 108 | ) |
109 | target_link_libraries(GraphicsEngineD3D12Interface | |
109 | target_link_libraries(Diligent-GraphicsEngineD3D12Interface | |
110 | 110 | INTERFACE |
111 | GraphicsEngineD3DBaseInterface | |
111 | Diligent-GraphicsEngineD3DBaseInterface | |
112 | 112 | ) |
113 | 113 | |
114 | add_library(GraphicsEngineD3D12-static STATIC | |
114 | add_library(Diligent-GraphicsEngineD3D12-static STATIC | |
115 | 115 | ${SRC} ${INTERFACE} ${INCLUDE} ${SHADERS} |
116 | 116 | readme.md |
117 | 117 | shaders/GenerateMips/GenerateMipsCS.hlsli |
118 | 118 | ) |
119 | 119 | |
120 | add_library(GraphicsEngineD3D12-shared SHARED | |
120 | add_library(Diligent-GraphicsEngineD3D12-shared SHARED | |
121 | 121 | src/DLLMain.cpp |
122 | 122 | src/GraphicsEngineD3D12.def |
123 | 123 | readme.md |
124 | 124 | ) |
125 | 125 | |
126 | target_include_directories(GraphicsEngineD3D12-static | |
126 | target_include_directories(Diligent-GraphicsEngineD3D12-static | |
127 | 127 | PRIVATE |
128 | 128 | ${CMAKE_CURRENT_BINARY_DIR}/CompiledShaders |
129 | 129 | include |
130 | 130 | ) |
131 | 131 | |
132 | target_link_libraries(GraphicsEngineD3D12-static | |
132 | target_link_libraries(Diligent-GraphicsEngineD3D12-static | |
133 | 133 | PRIVATE |
134 | BuildSettings | |
135 | Common | |
136 | GraphicsEngineD3DBase | |
137 | GraphicsEngineNextGenBase | |
138 | TargetPlatform | |
134 | Diligent-BuildSettings | |
135 | Diligent-Common | |
136 | Diligent-GraphicsEngineD3DBase | |
137 | Diligent-GraphicsEngineNextGenBase | |
138 | Diligent-TargetPlatform | |
139 | 139 | dxgi.lib |
140 | 140 | D3D12.lib |
141 | 141 | d3dcompiler.lib |
142 | 142 | PUBLIC |
143 | GraphicsEngineD3D12Interface | |
143 | Diligent-GraphicsEngineD3D12Interface | |
144 | 144 | ) |
145 | 145 | |
146 | target_link_libraries(GraphicsEngineD3D12-shared | |
146 | target_link_libraries(Diligent-GraphicsEngineD3D12-shared | |
147 | 147 | PRIVATE |
148 | BuildSettings | |
149 | GraphicsEngineD3D12-static | |
148 | Diligent-BuildSettings | |
149 | Diligent-GraphicsEngineD3D12-static | |
150 | 150 | PUBLIC |
151 | GraphicsEngineD3D12Interface | |
151 | Diligent-GraphicsEngineD3D12Interface | |
152 | 152 | ) |
153 | target_compile_definitions(GraphicsEngineD3D12-shared PUBLIC ENGINE_DLL=1) | |
153 | target_compile_definitions(Diligent-GraphicsEngineD3D12-shared PUBLIC ENGINE_DLL=1) | |
154 | 154 | |
155 | 155 | # Set output name to GraphicsEngineD3D12_{32|64}{r|d} |
156 | set_dll_output_name(GraphicsEngineD3D12-shared GraphicsEngineD3D12) | |
156 | set_dll_output_name(Diligent-GraphicsEngineD3D12-shared GraphicsEngineD3D12) | |
157 | 157 | |
158 | set_common_target_properties(GraphicsEngineD3D12-shared) | |
159 | set_common_target_properties(GraphicsEngineD3D12-static) | |
158 | set_common_target_properties(Diligent-GraphicsEngineD3D12-shared) | |
159 | set_common_target_properties(Diligent-GraphicsEngineD3D12-static) | |
160 | 160 | |
161 | 161 | source_group("src" FILES ${SRC}) |
162 | 162 | |
172 | 172 | shaders/GenerateMips/GenerateMipsCS.hlsli |
173 | 173 | ) |
174 | 174 | |
175 | set_target_properties(GraphicsEngineD3D12-static PROPERTIES | |
176 | FOLDER Core/Graphics | |
175 | set_target_properties(Diligent-GraphicsEngineD3D12-static PROPERTIES | |
176 | FOLDER DiligentCore/Graphics | |
177 | 177 | ) |
178 | set_target_properties(GraphicsEngineD3D12-shared PROPERTIES | |
179 | FOLDER Core/Graphics | |
178 | set_target_properties(Diligent-GraphicsEngineD3D12-shared PROPERTIES | |
179 | FOLDER DiligentCore/Graphics | |
180 | 180 | ) |
181 | 181 | |
182 | 182 | set_source_files_properties( |
184 | 184 | ) |
185 | 185 | |
186 | 186 | if(INSTALL_DILIGENT_CORE) |
187 | install_core_lib(GraphicsEngineD3D12-shared) | |
188 | install_core_lib(GraphicsEngineD3D12-static) | |
187 | install_core_lib(Diligent-GraphicsEngineD3D12-shared) | |
188 | install_core_lib(Diligent-GraphicsEngineD3D12-static) | |
189 | 189 | endif()⏎ |
0 | 0 | cmake_minimum_required (VERSION 3.10) |
1 | 1 | |
2 | project(GraphicsEngineD3DBase CXX) | |
2 | project(Diligent-GraphicsEngineD3DBase CXX) | |
3 | 3 | |
4 | 4 | set(INCLUDE |
5 | 5 | include/D3DErrors.h |
26 | 26 | src/ShaderResources.cpp |
27 | 27 | ) |
28 | 28 | |
29 | add_library(GraphicsEngineD3DBase STATIC | |
29 | add_library(Diligent-GraphicsEngineD3DBase STATIC | |
30 | 30 | ${SOURCE} ${INCLUDE} ${INTERFACE} include/HLSLDefinitions_inc.fxh |
31 | 31 | ) |
32 | 32 | |
36 | 36 | ) |
37 | 37 | |
38 | 38 | # Create custom target to convert HLSLDefinitions.fxh to HLSLDefinitions_inc.fxh |
39 | add_custom_target(ProcessHLSLDefinitions | |
39 | add_custom_target(Diligent-ProcessHLSLDefinitions | |
40 | 40 | SOURCES |
41 | 41 | include/HLSLDefinitions.fxh |
42 | 42 | ) |
43 | 43 | |
44 | add_custom_command(TARGET ProcessHLSLDefinitions | |
45 | # Unfortunately it is not possible to set TARGET directly to GraphicsEngineD3DBase | |
44 | add_custom_command(TARGET Diligent-ProcessHLSLDefinitions | |
45 | # Unfortunately it is not possible to set TARGET directly to Diligent-GraphicsEngineD3DBase | |
46 | 46 | # because PRE_BUILD is only supported on Visual Studio 8 or later. For all other generators |
47 | 47 | # PRE_BUILD is treated as PRE_LINK. |
48 | 48 | COMMAND ${FILE2STRING_PATH} include/HLSLDefinitions.fxh include/HLSLDefinitions_inc.fxh |
51 | 51 | VERBATIM |
52 | 52 | ) |
53 | 53 | |
54 | add_dependencies(GraphicsEngineD3DBase ProcessHLSLDefinitions) | |
54 | add_dependencies(Diligent-GraphicsEngineD3DBase Diligent-ProcessHLSLDefinitions) | |
55 | 55 | |
56 | add_library(GraphicsEngineD3DBaseInterface INTERFACE) | |
57 | target_link_libraries(GraphicsEngineD3DBaseInterface INTERFACE GraphicsEngineInterface) | |
58 | target_include_directories(GraphicsEngineD3DBaseInterface INTERFACE interface) | |
56 | add_library(Diligent-GraphicsEngineD3DBaseInterface INTERFACE) | |
57 | target_link_libraries(Diligent-GraphicsEngineD3DBaseInterface INTERFACE Diligent-GraphicsEngineInterface) | |
58 | target_include_directories(Diligent-GraphicsEngineD3DBaseInterface INTERFACE interface) | |
59 | 59 | |
60 | target_include_directories(GraphicsEngineD3DBase | |
60 | target_include_directories(Diligent-GraphicsEngineD3DBase | |
61 | 61 | PUBLIC |
62 | 62 | include |
63 | 63 | ) |
64 | 64 | |
65 | target_link_libraries(GraphicsEngineD3DBase | |
65 | target_link_libraries(Diligent-GraphicsEngineD3DBase | |
66 | 66 | PUBLIC |
67 | BuildSettings | |
68 | GraphicsEngine | |
69 | GraphicsEngineD3DBaseInterface | |
67 | Diligent-BuildSettings | |
68 | Diligent-GraphicsEngine | |
69 | Diligent-GraphicsEngineD3DBaseInterface | |
70 | 70 | ) |
71 | 71 | if(D3D12_SUPPORTED) |
72 | target_link_libraries(GraphicsEngineD3DBase PRIVATE D3D12.lib) | |
72 | target_link_libraries(Diligent-GraphicsEngineD3DBase PRIVATE D3D12.lib) | |
73 | 73 | endif() |
74 | set_common_target_properties(GraphicsEngineD3DBase) | |
74 | set_common_target_properties(Diligent-GraphicsEngineD3DBase) | |
75 | 75 | |
76 | 76 | source_group("src" FILES ${SOURCE}) |
77 | 77 | source_group("include" FILES ${INCLUDE}) |
78 | 78 | source_group("interface" FILES ${INTERFACE}) |
79 | 79 | source_group("generated" FILES include/HLSLDefinitions_inc.fxh) |
80 | 80 | |
81 | set_target_properties(GraphicsEngineD3DBase PROPERTIES | |
82 | FOLDER Core/Graphics | |
81 | set_target_properties(Diligent-GraphicsEngineD3DBase PROPERTIES | |
82 | FOLDER DiligentCore/Graphics | |
83 | 83 | ) |
84 | set_target_properties(ProcessHLSLDefinitions PROPERTIES | |
85 | FOLDER Core/Graphics/Helper | |
84 | set_target_properties(Diligent-ProcessHLSLDefinitions PROPERTIES | |
85 | FOLDER DiligentCore/Graphics/Helper | |
86 | 86 | ) |
87 | 87 | |
88 | 88 | if(INSTALL_DILIGENT_CORE) |
89 | install_core_lib(GraphicsEngineD3DBase) | |
89 | install_core_lib(Diligent-GraphicsEngineD3DBase) | |
90 | 90 | endif()⏎ |
0 | 0 | cmake_minimum_required (VERSION 3.10) |
1 | 1 | |
2 | project(GraphicsEngineMetal CXX) | |
2 | project(Diligent-GraphicsEngineMetal CXX) | |
3 | 3 | |
4 | 4 | |
5 | 5 | set(INCLUDE |
54 | 54 | src/TextureViewMtlImpl.mm |
55 | 55 | ) |
56 | 56 | |
57 | add_library(GraphicsEngineMetalInterface INTERFACE) | |
58 | target_include_directories(GraphicsEngineMetalInterface | |
57 | add_library(Diligent-GraphicsEngineMetalInterface INTERFACE) | |
58 | target_include_directories(Diligent-GraphicsEngineMetalInterface | |
59 | 59 | INTERFACE |
60 | 60 | interface |
61 | 61 | ) |
62 | target_link_libraries(GraphicsEngineMetalInterface | |
62 | target_link_libraries(Diligent-GraphicsEngineMetalInterface | |
63 | 63 | INTERFACE |
64 | GraphicsEngineInterface | |
64 | Diligent-GraphicsEngineInterface | |
65 | 65 | ) |
66 | 66 | |
67 | 67 | |
68 | add_library(GraphicsEngineMetal-static STATIC | |
68 | add_library(Diligent-GraphicsEngineMetal-static STATIC | |
69 | 69 | ${SRC} ${INTERFACE} ${INCLUDE} |
70 | 70 | readme.md |
71 | 71 | ) |
72 | 72 | |
73 | add_library(GraphicsEngineMetal-shared SHARED | |
73 | add_library(Diligent-GraphicsEngineMetal-shared SHARED | |
74 | 74 | readme.md |
75 | 75 | ) |
76 | 76 | |
77 | set_target_properties(GraphicsEngineMetal-shared PROPERTIES | |
77 | set_target_properties(Diligent-GraphicsEngineMetal-shared PROPERTIES | |
78 | 78 | OUTPUT_NAME GraphicsEngineMetal |
79 | 79 | ) |
80 | 80 | |
81 | set_common_target_properties(GraphicsEngineMetal-shared) | |
82 | set_common_target_properties(GraphicsEngineMetal-static) | |
81 | set_common_target_properties(Diligent-GraphicsEngineMetal-shared) | |
82 | set_common_target_properties(Diligent-GraphicsEngineMetal-static) | |
83 | 83 | |
84 | target_include_directories(GraphicsEngineMetal-static | |
84 | target_include_directories(Diligent-GraphicsEngineMetal-static | |
85 | 85 | PRIVATE |
86 | 86 | include |
87 | 87 | ) |
91 | 91 | message(FATAL_ERROR "Metal framework is not found") |
92 | 92 | endif() |
93 | 93 | |
94 | target_link_libraries(GraphicsEngineMetal-static | |
94 | target_link_libraries(Diligent-GraphicsEngineMetal-static | |
95 | 95 | PRIVATE |
96 | BuildSettings | |
97 | TargetPlatform | |
98 | Common | |
99 | GraphicsEngine | |
96 | Diligent-BuildSettings | |
97 | Diligent-TargetPlatform | |
98 | Diligent-Common | |
99 | Diligent-GraphicsEngine | |
100 | 100 | ${METAL_FRAMEWORK} |
101 | 101 | PUBLIC |
102 | GraphicsEngineMetalInterface | |
102 | Diligent-GraphicsEngineMetalInterface | |
103 | 103 | ) |
104 | 104 | |
105 | target_link_libraries(GraphicsEngineMetal-shared PUBLIC GraphicsEngineMetal-static) | |
106 | target_compile_definitions(GraphicsEngineMetal-shared PUBLIC ENGINE_DLL=1) | |
105 | target_link_libraries(Diligent-GraphicsEngineMetal-shared PUBLIC Diligent-GraphicsEngineMetal-static) | |
106 | target_compile_definitions(Diligent-GraphicsEngineMetal-shared PUBLIC ENGINE_DLL=1) | |
107 | 107 | |
108 | 108 | |
109 | 109 | if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR |
110 | 110 | CMAKE_CXX_COMPILER_ID MATCHES "GNU") |
111 | set_target_properties(GraphicsEngineMetal-shared PROPERTIES CXX_VISIBILITY_PRESET hidden) # -fvisibility=hidden | |
111 | set_target_properties(Diligent-GraphicsEngineMetal-shared PROPERTIES CXX_VISIBILITY_PRESET hidden) # -fvisibility=hidden | |
112 | 112 | endif() |
113 | 113 | |
114 | 114 | if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
115 | 115 | # Disable the following clang warning |
116 | 116 | # '<function name>' hides overloaded virtual function |
117 | 117 | # as hiding is intended |
118 | target_compile_options(GraphicsEngineMetal-static PRIVATE -Wno-overloaded-virtual) | |
119 | target_compile_options(GraphicsEngineMetal-shared PRIVATE -Wno-overloaded-virtual) | |
118 | target_compile_options(Diligent-GraphicsEngineMetal-static PRIVATE -Wno-overloaded-virtual) | |
119 | target_compile_options(Diligent-GraphicsEngineMetal-shared PRIVATE -Wno-overloaded-virtual) | |
120 | 120 | endif() |
121 | 121 | |
122 | 122 | |
124 | 124 | source_group("include" FILES ${INCLUDE}) |
125 | 125 | source_group("interface" FILES ${INTERFACE}) |
126 | 126 | |
127 | set_target_properties(GraphicsEngineMetal-static PROPERTIES | |
128 | FOLDER Core/Graphics | |
127 | set_target_properties(Diligent-GraphicsEngineMetal-static PROPERTIES | |
128 | FOLDER DiligentCore/Graphics | |
129 | 129 | ) |
130 | set_target_properties(GraphicsEngineMetal-shared PROPERTIES | |
131 | FOLDER Core/Graphics | |
130 | set_target_properties(Diligent-GraphicsEngineMetal-shared PROPERTIES | |
131 | FOLDER DiligentCore/Graphics | |
132 | 132 | ) |
133 | 133 | |
134 | 134 | set_source_files_properties( |
136 | 136 | ) |
137 | 137 | |
138 | 138 | if(INSTALL_DILIGENT_CORE) |
139 | install_core_lib(GraphicsEngineMetal-shared) | |
140 | install_core_lib(GraphicsEngineMetal-static) | |
139 | install_core_lib(Diligent-GraphicsEngineMetal-shared) | |
140 | install_core_lib(Diligent-GraphicsEngineMetal-static) | |
141 | 141 | endif() |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(GraphicsEngineNextGenBase CXX) | |
2 | project(Diligent-GraphicsEngineNextGenBase CXX) | |
3 | 3 | |
4 | 4 | set(INCLUDE |
5 | 5 | include/DeviceContextNextGenBase.h |
11 | 11 | src/dummy.cpp |
12 | 12 | ) |
13 | 13 | |
14 | add_library(GraphicsEngineNextGenBase STATIC ${SOURCE} ${INCLUDE}) | |
15 | set_common_target_properties(GraphicsEngineNextGenBase) | |
14 | add_library(Diligent-GraphicsEngineNextGenBase STATIC ${SOURCE} ${INCLUDE}) | |
15 | set_common_target_properties(Diligent-GraphicsEngineNextGenBase) | |
16 | 16 | |
17 | target_include_directories(GraphicsEngineNextGenBase | |
17 | target_include_directories(Diligent-GraphicsEngineNextGenBase | |
18 | 18 | PUBLIC |
19 | 19 | include |
20 | 20 | ) |
21 | 21 | |
22 | target_link_libraries(GraphicsEngineNextGenBase | |
22 | target_link_libraries(Diligent-GraphicsEngineNextGenBase | |
23 | 23 | PUBLIC |
24 | BuildSettings | |
25 | PlatformInterface | |
26 | Common | |
27 | GraphicsAccessories | |
28 | GraphicsEngine | |
24 | Diligent-BuildSettings | |
25 | Diligent-PlatformInterface | |
26 | Diligent-Common | |
27 | Diligent-GraphicsAccessories | |
28 | Diligent-GraphicsEngine | |
29 | 29 | ) |
30 | 30 | |
31 | 31 | source_group("src" FILES ${SOURCE}) |
32 | 32 | source_group("include" FILES ${INCLUDE}) |
33 | 33 | |
34 | set_target_properties(GraphicsEngineNextGenBase PROPERTIES | |
35 | FOLDER Core/Graphics | |
34 | set_target_properties(Diligent-GraphicsEngineNextGenBase PROPERTIES | |
35 | FOLDER DiligentCore/Graphics | |
36 | 36 | ) |
37 | 37 | |
38 | 38 | if(INSTALL_DILIGENT_CORE) |
39 | install_core_lib(GraphicsEngineNextGenBase) | |
39 | install_core_lib(Diligent-GraphicsEngineNextGenBase) | |
40 | 40 | endif()⏎ |
0 | 0 | cmake_minimum_required (VERSION 3.3) |
1 | 1 | |
2 | project(GraphicsEngineOpenGL CXX) | |
2 | project(Diligent-GraphicsEngineOpenGL CXX) | |
3 | 3 | |
4 | 4 | set(INCLUDE |
5 | 5 | include/AsyncWritableResource.h |
117 | 117 | message(FATAL_ERROR "Unknown platform") |
118 | 118 | endif() |
119 | 119 | |
120 | add_library(GraphicsEngineOpenGLInterface INTERFACE) | |
121 | target_include_directories(GraphicsEngineOpenGLInterface | |
120 | add_library(Diligent-GraphicsEngineOpenGLInterface INTERFACE) | |
121 | target_include_directories(Diligent-GraphicsEngineOpenGLInterface | |
122 | 122 | INTERFACE |
123 | 123 | interface |
124 | 124 | ) |
125 | target_link_libraries(GraphicsEngineOpenGLInterface | |
125 | target_link_libraries(Diligent-GraphicsEngineOpenGLInterface | |
126 | 126 | INTERFACE |
127 | GraphicsEngineInterface | |
128 | ) | |
129 | ||
130 | ||
131 | add_library(GraphicsEngineOpenGL-static STATIC | |
127 | Diligent-GraphicsEngineInterface | |
128 | ) | |
129 | ||
130 | ||
131 | add_library(Diligent-GraphicsEngineOpenGL-static STATIC | |
132 | 132 | ${SOURCE} ${INTERFACE} ${INCLUDE} |
133 | 133 | readme.md |
134 | 134 | ) |
135 | 135 | |
136 | add_library(GraphicsEngineOpenGL-shared SHARED | |
136 | add_library(Diligent-GraphicsEngineOpenGL-shared SHARED | |
137 | 137 | readme.md |
138 | 138 | ) |
139 | 139 | if(MSVC) |
140 | target_sources(GraphicsEngineOpenGL-shared | |
140 | target_sources(Diligent-GraphicsEngineOpenGL-shared | |
141 | 141 | PRIVATE |
142 | 142 | src/DLLMain.cpp |
143 | 143 | src/GraphicsEngineOpenGL.def |
144 | 144 | ) |
145 | 145 | endif() |
146 | 146 | |
147 | target_include_directories(GraphicsEngineOpenGL-static | |
147 | target_include_directories(Diligent-GraphicsEngineOpenGL-static | |
148 | 148 | PRIVATE |
149 | 149 | include |
150 | 150 | ../HLSL2GLSLConverterLib/include |
152 | 152 | |
153 | 153 | |
154 | 154 | set(PRIVATE_DEPENDENCIES |
155 | BuildSettings | |
156 | Common | |
157 | TargetPlatform | |
158 | GraphicsEngine | |
159 | GLSLTools | |
160 | HLSL2GLSLConverterLib | |
155 | Diligent-BuildSettings | |
156 | Diligent-Common | |
157 | Diligent-TargetPlatform | |
158 | Diligent-GraphicsEngine | |
159 | Diligent-GLSLTools | |
160 | Diligent-HLSL2GLSLConverterLib | |
161 | 161 | ) |
162 | 162 | |
163 | 163 | set(PUBLIC_DEPENDENCIES |
164 | GraphicsEngineOpenGLInterface | |
164 | Diligent-GraphicsEngineOpenGLInterface | |
165 | 165 | ) |
166 | 166 | |
167 | 167 | if(PLATFORM_WIN32) |
183 | 183 | # Disable the following clang warning |
184 | 184 | # '<function name>' hides overloaded virtual function |
185 | 185 | # as hiding is intended |
186 | target_compile_options(GraphicsEngineOpenGL-static PRIVATE -Wno-overloaded-virtual) | |
187 | target_compile_options(GraphicsEngineOpenGL-shared PRIVATE -Wno-overloaded-virtual) | |
188 | endif() | |
189 | ||
190 | target_link_libraries(GraphicsEngineOpenGL-static | |
186 | target_compile_options(Diligent-GraphicsEngineOpenGL-static PRIVATE -Wno-overloaded-virtual) | |
187 | target_compile_options(Diligent-GraphicsEngineOpenGL-shared PRIVATE -Wno-overloaded-virtual) | |
188 | endif() | |
189 | ||
190 | target_link_libraries(Diligent-GraphicsEngineOpenGL-static | |
191 | 191 | PRIVATE |
192 | 192 | ${PRIVATE_DEPENDENCIES} |
193 | 193 | PUBLIC |
194 | 194 | ${PUBLIC_DEPENDENCIES} |
195 | 195 | ) |
196 | target_link_libraries(GraphicsEngineOpenGL-shared | |
196 | target_link_libraries(Diligent-GraphicsEngineOpenGL-shared | |
197 | 197 | PRIVATE |
198 | BuildSettings | |
199 | ${WHOLE_ARCHIVE_FLAG} GraphicsEngineOpenGL-static ${NO_WHOLE_ARCHIVE_FLAG} | |
198 | Diligent-BuildSettings | |
199 | ${WHOLE_ARCHIVE_FLAG} Diligent-GraphicsEngineOpenGL-static ${NO_WHOLE_ARCHIVE_FLAG} | |
200 | 200 | PUBLIC |
201 | 201 | ${PUBLIC_DEPENDENCIES} |
202 | 202 | ) |
203 | 203 | |
204 | target_compile_definitions(GraphicsEngineOpenGL-shared PUBLIC ENGINE_DLL=1) | |
204 | target_compile_definitions(Diligent-GraphicsEngineOpenGL-shared PUBLIC ENGINE_DLL=1) | |
205 | 205 | |
206 | 206 | if(PLATFORM_WIN32) |
207 | 207 | |
208 | 208 | # Do not add 'lib' prefix when building with MinGW |
209 | set_target_properties(GraphicsEngineOpenGL-shared PROPERTIES PREFIX "") | |
209 | set_target_properties(Diligent-GraphicsEngineOpenGL-shared PROPERTIES PREFIX "") | |
210 | 210 | |
211 | 211 | # Set output name to GraphicsEngineOpenGL_{32|64}{r|d} |
212 | set_dll_output_name(GraphicsEngineOpenGL-shared GraphicsEngineOpenGL) | |
212 | set_dll_output_name(Diligent-GraphicsEngineOpenGL-shared GraphicsEngineOpenGL) | |
213 | 213 | |
214 | 214 | else() |
215 | set_target_properties(GraphicsEngineOpenGL-shared PROPERTIES | |
215 | set_target_properties(Diligent-GraphicsEngineOpenGL-shared PROPERTIES | |
216 | 216 | OUTPUT_NAME GraphicsEngineOpenGL |
217 | 217 | ) |
218 | 218 | endif() |
219 | 219 | |
220 | set_common_target_properties(GraphicsEngineOpenGL-shared) | |
221 | set_common_target_properties(GraphicsEngineOpenGL-static) | |
220 | set_common_target_properties(Diligent-GraphicsEngineOpenGL-shared) | |
221 | set_common_target_properties(Diligent-GraphicsEngineOpenGL-static) | |
222 | 222 | |
223 | 223 | source_group("src" FILES ${SOURCE}) |
224 | 224 | if(PLATFORM_WIN32) |
231 | 231 | source_group("include" FILES ${INCLUDE}) |
232 | 232 | source_group("interface" FILES ${INTERFACE}) |
233 | 233 | |
234 | set_target_properties(GraphicsEngineOpenGL-static PROPERTIES | |
235 | FOLDER Core/Graphics | |
236 | ) | |
237 | set_target_properties(GraphicsEngineOpenGL-shared PROPERTIES | |
238 | FOLDER Core/Graphics | |
234 | set_target_properties(Diligent-GraphicsEngineOpenGL-static PROPERTIES | |
235 | FOLDER DiligentCore/Graphics | |
236 | ) | |
237 | set_target_properties(Diligent-GraphicsEngineOpenGL-shared PROPERTIES | |
238 | FOLDER DiligentCore/Graphics | |
239 | 239 | ) |
240 | 240 | |
241 | 241 | set_source_files_properties( |
243 | 243 | ) |
244 | 244 | |
245 | 245 | if(INSTALL_DILIGENT_CORE) |
246 | install_core_lib(GraphicsEngineOpenGL-shared) | |
247 | install_core_lib(GraphicsEngineOpenGL-static) | |
248 | endif() | |
246 | install_core_lib(Diligent-GraphicsEngineOpenGL-shared) | |
247 | install_core_lib(Diligent-GraphicsEngineOpenGL-static) | |
248 | endif() |
0 | 0 | cmake_minimum_required (VERSION 3.10) |
1 | 1 | |
2 | project(GraphicsEngineVk CXX) | |
2 | project(Diligent-GraphicsEngineVk CXX) | |
3 | 3 | |
4 | 4 | set(INCLUDE |
5 | 5 | include/BufferVkImpl.h |
116 | 116 | ) |
117 | 117 | |
118 | 118 | # Create custom target to convert GenerateMipsCS.csh to GenerateMipsCS_inc.h |
119 | add_custom_target(ProcessGenerateMipsVkShader | |
119 | add_custom_target(Diligent-ProcessGenerateMipsVkShader | |
120 | 120 | SOURCES |
121 | 121 | ${GENERATE_MIPS_SHADER} |
122 | 122 | ) |
123 | 123 | |
124 | add_custom_command(TARGET ProcessGenerateMipsVkShader | |
125 | # Unfortunately it is not possible to set TARGET directly to GraphicsEngineVk-* | |
124 | add_custom_command(TARGET Diligent-ProcessGenerateMipsVkShader | |
125 | # Unfortunately it is not possible to set TARGET directly to Diligent-GraphicsEngineVk-* | |
126 | 126 | # because PRE_BUILD is only supported on Visual Studio 8 or later. For all other generators |
127 | 127 | # PRE_BUILD is treated as PRE_LINK. |
128 | 128 | COMMAND ${FILE2STRING_PATH} ${GENERATE_MIPS_SHADER} ${GENERATE_MIPS_SHADER_INC} |
132 | 132 | ) |
133 | 133 | |
134 | 134 | |
135 | add_library(GraphicsEngineVkInterface INTERFACE) | |
136 | target_include_directories(GraphicsEngineVkInterface | |
135 | add_library(Diligent-GraphicsEngineVkInterface INTERFACE) | |
136 | target_include_directories(Diligent-GraphicsEngineVkInterface | |
137 | 137 | INTERFACE |
138 | 138 | interface |
139 | 139 | ) |
140 | target_link_libraries(GraphicsEngineVkInterface | |
140 | target_link_libraries(Diligent-GraphicsEngineVkInterface | |
141 | 141 | INTERFACE |
142 | GraphicsEngineInterface | |
143 | ) | |
144 | ||
145 | add_library(GraphicsEngineVk-static STATIC | |
142 | Diligent-GraphicsEngineInterface | |
143 | ) | |
144 | ||
145 | add_library(Diligent-GraphicsEngineVk-static STATIC | |
146 | 146 | ${SRC} ${VULKAN_UTILS_SRC} ${INTERFACE} ${INCLUDE} ${VULKAN_UTILS_INCLUDE} ${GENERATE_MIPS_SHADER} ${GENERATE_MIPS_SHADER_INC} |
147 | 147 | readme.md |
148 | 148 | ) |
149 | 149 | |
150 | add_library(GraphicsEngineVk-shared SHARED | |
150 | add_library(Diligent-GraphicsEngineVk-shared SHARED | |
151 | 151 | readme.md |
152 | 152 | ) |
153 | 153 | |
154 | 154 | if(MSVC) |
155 | target_sources(GraphicsEngineVk-shared PRIVATE | |
155 | target_sources(Diligent-GraphicsEngineVk-shared PRIVATE | |
156 | 156 | src/DLLMain.cpp |
157 | 157 | src/GraphicsEngineVk.def |
158 | 158 | ) |
159 | 159 | endif() |
160 | 160 | |
161 | add_dependencies(GraphicsEngineVk-static ProcessGenerateMipsVkShader) | |
162 | ||
163 | target_include_directories(GraphicsEngineVk-static | |
161 | add_dependencies(Diligent-GraphicsEngineVk-static Diligent-ProcessGenerateMipsVkShader) | |
162 | ||
163 | target_include_directories(Diligent-GraphicsEngineVk-static | |
164 | 164 | PRIVATE |
165 | 165 | include |
166 | 166 | ../../External/vulkan |
167 | 167 | ) |
168 | 168 | |
169 | 169 | set(PRIVATE_DEPENDENCIES |
170 | BuildSettings | |
171 | Common | |
172 | TargetPlatform | |
173 | GraphicsEngineNextGenBase | |
174 | GLSLTools | |
170 | Diligent-BuildSettings | |
171 | Diligent-Common | |
172 | Diligent-TargetPlatform | |
173 | Diligent-GraphicsEngineNextGenBase | |
174 | Diligent-GLSLTools | |
175 | 175 | SPIRV-Tools-opt |
176 | 176 | ) |
177 | 177 | |
189 | 189 | list(APPEND PRIVATE_DEPENDENCIES ${Vulkan_LIBRARY}) |
190 | 190 | |
191 | 191 | set(PUBLIC_DEPENDENCIES |
192 | GraphicsEngineVkInterface | |
193 | ) | |
194 | ||
195 | target_link_libraries(GraphicsEngineVk-static | |
192 | Diligent-GraphicsEngineVkInterface | |
193 | ) | |
194 | ||
195 | target_link_libraries(Diligent-GraphicsEngineVk-static | |
196 | 196 | PRIVATE |
197 | 197 | ${PRIVATE_DEPENDENCIES} |
198 | 198 | PUBLIC |
199 | 199 | ${PUBLIC_DEPENDENCIES} |
200 | 200 | ) |
201 | target_link_libraries(GraphicsEngineVk-shared | |
201 | target_link_libraries(Diligent-GraphicsEngineVk-shared | |
202 | 202 | PRIVATE |
203 | BuildSettings | |
204 | ${WHOLE_ARCHIVE_FLAG} GraphicsEngineVk-static ${NO_WHOLE_ARCHIVE_FLAG} | |
203 | Diligent-BuildSettings | |
204 | ${WHOLE_ARCHIVE_FLAG} Diligent-GraphicsEngineVk-static ${NO_WHOLE_ARCHIVE_FLAG} | |
205 | 205 | PUBLIC |
206 | 206 | ${PUBLIC_DEPENDENCIES} |
207 | 207 | ) |
210 | 210 | # Disable the following clang warning |
211 | 211 | # '<function name>' hides overloaded virtual function |
212 | 212 | # as hiding is intended |
213 | target_compile_options(GraphicsEngineVk-static PRIVATE -Wno-overloaded-virtual) | |
214 | target_compile_options(GraphicsEngineVk-shared PRIVATE -Wno-overloaded-virtual) | |
213 | target_compile_options(Diligent-GraphicsEngineVk-static PRIVATE -Wno-overloaded-virtual) | |
214 | target_compile_options(Diligent-GraphicsEngineVk-shared PRIVATE -Wno-overloaded-virtual) | |
215 | 215 | endif() |
216 | 216 | |
217 | 217 | if(PLATFORM_WIN32) |
232 | 232 | message("GLSLang is not being built. Vulkan backend will only be able to consume SPIRV byte code.") |
233 | 233 | endif() |
234 | 234 | |
235 | target_compile_definitions(GraphicsEngineVk-static PRIVATE ${PRIVATE_COMPILE_DEFINITIONS} NO_GLSLANG=$<BOOL:${DILIGENT_NO_GLSLANG}>) | |
236 | target_compile_definitions(GraphicsEngineVk-shared PRIVATE ${PRIVATE_COMPILE_DEFINITIONS} ENGINE_DLL=1) | |
235 | target_compile_definitions(Diligent-GraphicsEngineVk-static PRIVATE ${PRIVATE_COMPILE_DEFINITIONS} NO_GLSLANG=$<BOOL:${DILIGENT_NO_GLSLANG}>) | |
236 | target_compile_definitions(Diligent-GraphicsEngineVk-shared PRIVATE ${PRIVATE_COMPILE_DEFINITIONS} ENGINE_DLL=1) | |
237 | 237 | |
238 | 238 | if(PLATFORM_WIN32) |
239 | 239 | |
240 | 240 | # Do not add 'lib' prefix when building with MinGW |
241 | set_target_properties(GraphicsEngineVk-shared PROPERTIES PREFIX "") | |
241 | set_target_properties(Diligent-GraphicsEngineVk-shared PROPERTIES PREFIX "") | |
242 | 242 | |
243 | 243 | # Set output name to GraphicsEngineVk_{32|64}{r|d} |
244 | set_dll_output_name(GraphicsEngineVk-shared GraphicsEngineVk) | |
244 | set_dll_output_name(Diligent-GraphicsEngineVk-shared GraphicsEngineVk) | |
245 | 245 | |
246 | 246 | else() |
247 | set_target_properties(GraphicsEngineVk-shared PROPERTIES | |
248 | OUTPUT_NAME GraphicsEngineVk | |
247 | set_target_properties(Diligent-GraphicsEngineVk-shared PROPERTIES | |
248 | OUTPUT_NAME Diligent-GraphicsEngineVk | |
249 | 249 | ) |
250 | 250 | endif() |
251 | 251 | |
252 | 252 | if(PLATFORM_LINUX) |
253 | 253 | get_filename_component(VULKAN_LIBRARY_PATH ${Vulkan_LIBRARY} DIRECTORY) |
254 | set_target_properties(GraphicsEngineVk-shared PROPERTIES | |
254 | set_target_properties(Diligent-GraphicsEngineVk-shared PROPERTIES | |
255 | 255 | INSTALL_RPATH "${VULKAN_LIBRARY_PATH}" |
256 | 256 | ) |
257 | 257 | endif() |
258 | 258 | |
259 | set_common_target_properties(GraphicsEngineVk-shared) | |
260 | set_common_target_properties(GraphicsEngineVk-static) | |
259 | set_common_target_properties(Diligent-GraphicsEngineVk-shared) | |
260 | set_common_target_properties(Diligent-GraphicsEngineVk-static) | |
261 | 261 | |
262 | 262 | source_group("src" FILES ${SRC}) |
263 | 263 | source_group("src\\Vulkan Utilities" FILES ${VULKAN_UTILS_SRC}) |
277 | 277 | ${GENERATE_MIPS_SHADER_INC} |
278 | 278 | ) |
279 | 279 | |
280 | set_target_properties(GraphicsEngineVk-static PROPERTIES | |
281 | FOLDER Core/Graphics | |
282 | ) | |
283 | set_target_properties(GraphicsEngineVk-shared PROPERTIES | |
284 | FOLDER Core/Graphics | |
280 | set_target_properties(Diligent-GraphicsEngineVk-static PROPERTIES | |
281 | FOLDER DiligentCore/Graphics | |
282 | ) | |
283 | set_target_properties(Diligent-GraphicsEngineVk-shared PROPERTIES | |
284 | FOLDER DiligentCore/Graphics | |
285 | 285 | ) |
286 | 286 | |
287 | 287 | set_source_files_properties( |
288 | 288 | readme.md PROPERTIES HEADER_FILE_ONLY TRUE |
289 | 289 | ) |
290 | 290 | |
291 | set_target_properties(ProcessGenerateMipsVkShader PROPERTIES | |
292 | FOLDER Core/Graphics/Helper | |
291 | set_target_properties(Diligent-ProcessGenerateMipsVkShader PROPERTIES | |
292 | FOLDER DiligentCore/Graphics/Helper | |
293 | 293 | ) |
294 | 294 | |
295 | 295 | if(INSTALL_DILIGENT_CORE) |
296 | install_core_lib(GraphicsEngineVk-shared) | |
297 | install_core_lib(GraphicsEngineVk-static) | |
298 | endif() | |
296 | install_core_lib(Diligent-GraphicsEngineVk-shared) | |
297 | install_core_lib(Diligent-GraphicsEngineVk-static) | |
298 | endif() |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(GraphicsTools CXX) | |
2 | project(Diligent-GraphicsTools CXX) | |
3 | 3 | |
4 | 4 | set(INCLUDE |
5 | 5 | include/CommonlyUsedStates.h |
23 | 23 | if(D3D11_SUPPORTED) |
24 | 24 | list(APPEND SOURCE src/TextureUploaderD3D11.cpp) |
25 | 25 | list(APPEND INCLUDE include/TextureUploaderD3D11.h) |
26 | list(APPEND DEPENDENCIES GraphicsEngineD3D11Interface) | |
26 | list(APPEND DEPENDENCIES Diligent-GraphicsEngineD3D11Interface) | |
27 | 27 | endif() |
28 | 28 | |
29 | 29 | if(D3D12_SUPPORTED OR VULKAN_SUPPORTED) |
34 | 34 | if(GL_SUPPORTED OR GLES_SUPPORTED) |
35 | 35 | list(APPEND SOURCE src/TextureUploaderGL.cpp) |
36 | 36 | list(APPEND INCLUDE include/TextureUploaderGL.h) |
37 | list(APPEND DEPENDENCIES GraphicsEngineOpenGLInterface) | |
37 | list(APPEND DEPENDENCIES Diligent-GraphicsEngineOpenGLInterface) | |
38 | 38 | endif() |
39 | 39 | |
40 | add_library(GraphicsTools STATIC ${SOURCE} ${INCLUDE}) | |
40 | add_library(Diligent-GraphicsTools STATIC ${SOURCE} ${INCLUDE}) | |
41 | 41 | |
42 | target_include_directories(GraphicsTools | |
42 | target_include_directories(Diligent-GraphicsTools | |
43 | 43 | PUBLIC |
44 | 44 | include |
45 | 45 | PRIVATE |
46 | 46 | ../GraphicsEngineD3DBase/include |
47 | 47 | ) |
48 | 48 | |
49 | target_link_libraries(GraphicsTools | |
49 | target_link_libraries(Diligent-GraphicsTools | |
50 | 50 | PRIVATE |
51 | Common | |
52 | BuildSettings | |
53 | PlatformInterface | |
54 | GraphicsAccessories | |
51 | Diligent-Common | |
52 | Diligent-BuildSettings | |
53 | Diligent-PlatformInterface | |
54 | Diligent-GraphicsAccessories | |
55 | 55 | ${DEPENDENCIES} |
56 | 56 | PUBLIC |
57 | GraphicsEngineInterface | |
57 | Diligent-GraphicsEngineInterface | |
58 | 58 | ) |
59 | 59 | |
60 | set_common_target_properties(GraphicsTools) | |
60 | set_common_target_properties(Diligent-GraphicsTools) | |
61 | 61 | |
62 | 62 | source_group("src" FILES ${SOURCE}) |
63 | 63 | source_group("include" FILES ${INCLUDE}) |
64 | 64 | source_group("interface" FILES ${INTERFACE}) |
65 | 65 | |
66 | set_target_properties(GraphicsTools PROPERTIES | |
67 | FOLDER Core/Graphics | |
66 | set_target_properties(Diligent-GraphicsTools PROPERTIES | |
67 | FOLDER DiligentCore/Graphics | |
68 | 68 | ) |
69 | 69 | |
70 | 70 | if(INSTALL_DILIGENT_CORE) |
71 | install_core_lib(GraphicsTools) | |
71 | install_core_lib(Diligent-GraphicsTools) | |
72 | 72 | endif()⏎ |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(HLSL2GLSLConverterLib CXX) | |
2 | project(Diligent-HLSL2GLSLConverterLib CXX) | |
3 | 3 | |
4 | 4 | set(INCLUDE |
5 | 5 | include/GLSLDefinitions.h |
17 | 17 | src/HLSL2GLSLConverterObject.cpp |
18 | 18 | ) |
19 | 19 | |
20 | add_library(HLSL2GLSLConverterLib STATIC ${SOURCE} ${INTERFACE} ${INCLUDE} include/GLSLDefinitions_inc.h) | |
21 | set_common_target_properties(HLSL2GLSLConverterLib) | |
20 | add_library(Diligent-HLSL2GLSLConverterLib STATIC ${SOURCE} ${INTERFACE} ${INCLUDE} include/GLSLDefinitions_inc.h) | |
21 | set_common_target_properties(Diligent-HLSL2GLSLConverterLib) | |
22 | 22 | |
23 | 23 | set_source_files_properties( |
24 | 24 | ${CMAKE_CURRENT_SOURCE_DIR}/include/GLSLDefinitions_inc.h |
25 | 25 | PROPERTIES GENERATED TRUE |
26 | 26 | ) |
27 | 27 | |
28 | target_include_directories(HLSL2GLSLConverterLib | |
28 | target_include_directories(Diligent-HLSL2GLSLConverterLib | |
29 | 29 | PUBLIC |
30 | 30 | interface |
31 | 31 | PRIVATE |
32 | 32 | include |
33 | 33 | ) |
34 | 34 | |
35 | target_link_libraries(HLSL2GLSLConverterLib | |
35 | target_link_libraries(Diligent-HLSL2GLSLConverterLib | |
36 | 36 | PRIVATE |
37 | BuildSettings | |
38 | Common | |
39 | PlatformInterface | |
40 | GraphicsEngine | |
37 | Diligent-BuildSettings | |
38 | Diligent-Common | |
39 | Diligent-PlatformInterface | |
40 | Diligent-GraphicsEngine | |
41 | 41 | PUBLIC |
42 | GraphicsEngineInterface | |
42 | Diligent-GraphicsEngineInterface | |
43 | 43 | ) |
44 | 44 | |
45 | 45 | if(NOT FILE2STRING_PATH STREQUAL "") |
46 | 46 | # Create custom target to convert GLSLDefinitions.h to GLSLDefinitions_inc.h |
47 | add_custom_target(ProcessGLSLDefinitions | |
47 | add_custom_target(Diligent-ProcessGLSLDefinitions | |
48 | 48 | SOURCES |
49 | 49 | include/GLSLDefinitions.h |
50 | 50 | ) |
51 | 51 | |
52 | add_custom_command(TARGET ProcessGLSLDefinitions | |
52 | add_custom_command(TARGET Diligent-ProcessGLSLDefinitions | |
53 | 53 | # Unfortunately it is not possible to set TARGET directly to HLSL2GLSLConverterLib |
54 | 54 | # because PRE_BUILD is only supported on Visual Studio 8 or later. For all other generators |
55 | 55 | # PRE_BUILD is treated as PRE_LINK. |
59 | 59 | VERBATIM |
60 | 60 | ) |
61 | 61 | |
62 | add_dependencies(HLSL2GLSLConverterLib ProcessGLSLDefinitions) | |
63 | set_target_properties(ProcessGLSLDefinitions PROPERTIES | |
64 | FOLDER Core/Graphics/Helper | |
62 | add_dependencies(Diligent-HLSL2GLSLConverterLib Diligent-ProcessGLSLDefinitions) | |
63 | set_target_properties(Diligent-ProcessGLSLDefinitions PROPERTIES | |
64 | FOLDER DiligentCore/Graphics/Helper | |
65 | 65 | ) |
66 | 66 | else() |
67 | 67 | message(WARNING "File2String utility is currently unavailable on this host system. This is not an issues unless you modify GLSLDefinitions.h file") |
72 | 72 | source_group("interface" FILES ${INTERFACE}) |
73 | 73 | source_group("generated" FILES include/GLSLDefinitions_inc.h) |
74 | 74 | |
75 | set_target_properties(HLSL2GLSLConverterLib PROPERTIES | |
76 | FOLDER Core/Graphics | |
75 | set_target_properties(Diligent-HLSL2GLSLConverterLib PROPERTIES | |
76 | FOLDER DiligentCore/Graphics | |
77 | 77 | ) |
78 | 78 | |
79 | 79 | if(INSTALL_DILIGENT_CORE) |
80 | install_core_lib(HLSL2GLSLConverterLib) | |
80 | install_core_lib(Diligent-HLSL2GLSLConverterLib) | |
81 | 81 | endif()⏎ |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(AndroidPlatform CXX) | |
2 | project(Diligent-AndroidPlatform CXX) | |
3 | 3 | |
4 | 4 | set(INTERFACE |
5 | 5 | interface/AndroidDebug.h |
13 | 13 | src/AndroidFileSystem.cpp |
14 | 14 | ) |
15 | 15 | |
16 | add_library(AndroidPlatform ${SOURCE} ${INTERFACE} ${PLATFORM_INTERFACE_HEADERS}) | |
17 | set_common_target_properties(AndroidPlatform) | |
16 | add_library(Diligent-AndroidPlatform ${SOURCE} ${INTERFACE} ${PLATFORM_INTERFACE_HEADERS}) | |
17 | set_common_target_properties(Diligent-AndroidPlatform) | |
18 | 18 | |
19 | target_include_directories(AndroidPlatform | |
19 | target_include_directories(Diligent-AndroidPlatform | |
20 | 20 | PUBLIC |
21 | 21 | interface |
22 | 22 | ) |
23 | 23 | |
24 | target_link_libraries(AndroidPlatform | |
24 | target_link_libraries(Diligent-AndroidPlatform | |
25 | 25 | PRIVATE |
26 | 26 | log |
27 | 27 | PUBLIC |
28 | BuildSettings | |
29 | PlatformInterface | |
30 | BasicPlatform | |
28 | Diligent-BuildSettings | |
29 | Diligent-PlatformInterface | |
30 | Diligent-BasicPlatform | |
31 | 31 | ) |
32 | 32 | |
33 | 33 | source_group("src" FILES ${SOURCE}) |
34 | 34 | source_group("include" FILES ${INCLUDE}) |
35 | 35 | source_group("interface" FILES ${PLATFORM_INTERFACE_HEADERS}) |
36 | 36 | |
37 | set_target_properties(AndroidPlatform PROPERTIES | |
38 | FOLDER Core/Platforms | |
37 | set_target_properties(Diligent-AndroidPlatform PROPERTIES | |
38 | FOLDER DiligentCore/Platforms | |
39 | 39 | ) |
40 | 40 | |
41 | 41 | if(INSTALL_DILIGENT_CORE) |
42 | install_core_lib(AndroidPlatform) | |
42 | install_core_lib(Diligent-AndroidPlatform) | |
43 | 43 | endif()⏎ |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(ApplePlatform CXX) | |
2 | project(Diligent-ApplePlatform CXX) | |
3 | 3 | |
4 | 4 | set(INTERFACE |
5 | 5 | interface/CFObjectWrapper.h |
15 | 15 | ) |
16 | 16 | |
17 | 17 | |
18 | add_library(ApplePlatform ${SOURCE} ${INTERFACE} ${PLATFORM_INTERFACE_HEADERS}) | |
19 | set_common_target_properties(ApplePlatform) | |
18 | add_library(Diligent-ApplePlatform ${SOURCE} ${INTERFACE} ${PLATFORM_INTERFACE_HEADERS}) | |
19 | set_common_target_properties(Diligent-ApplePlatform) | |
20 | 20 | |
21 | target_include_directories(ApplePlatform | |
21 | target_include_directories(Diligent-ApplePlatform | |
22 | 22 | PUBLIC |
23 | 23 | interface |
24 | 24 | ) |
25 | 25 | |
26 | target_link_libraries(ApplePlatform | |
26 | target_link_libraries(Diligent-ApplePlatform | |
27 | 27 | PUBLIC |
28 | BuildSettings | |
29 | BasicPlatform | |
30 | PlatformInterface | |
28 | Diligent-BuildSettings | |
29 | Diligent-BasicPlatform | |
30 | Diligent-PlatformInterface | |
31 | 31 | ) |
32 | 32 | |
33 | 33 | if(PLATFORM_MACOS) |
34 | target_link_libraries(ApplePlatform | |
34 | target_link_libraries(Diligent-ApplePlatform | |
35 | 35 | PRIVATE |
36 | 36 | ${APP_KIT} |
37 | 37 | ) |
38 | 38 | elseif(PLATFORM_IOS) |
39 | target_link_libraries(ApplePlatform | |
39 | target_link_libraries(Diligent-ApplePlatform | |
40 | 40 | PRIVATE |
41 | 41 | ${CORE_FOUNDATION} |
42 | 42 | ${FOUNDATION} |
47 | 47 | source_group("include" FILES ${INCLUDE}) |
48 | 48 | source_group("interface" FILES ${PLATFORM_INTERFACE_HEADERS}) |
49 | 49 | |
50 | set_target_properties(ApplePlatform PROPERTIES | |
51 | FOLDER Core/Platforms | |
50 | set_target_properties(Diligent-ApplePlatform PROPERTIES | |
51 | FOLDER DiligentCore/Platforms | |
52 | 52 | ) |
53 | 53 | |
54 | 54 | if(INSTALL_DILIGENT_CORE) |
55 | install_core_lib(ApplePlatform) | |
55 | install_core_lib(Diligent-ApplePlatform) | |
56 | 56 | endif() |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(BasicPlatform CXX) | |
2 | project(Diligent-BasicPlatform CXX) | |
3 | 3 | |
4 | 4 | set(SOURCE |
5 | 5 | src/BasicFileSystem.cpp |
19 | 19 | list(APPEND INTERFACE interface/StandardFile.h) |
20 | 20 | endif() |
21 | 21 | |
22 | add_library(BasicPlatform STATIC ${SOURCE} ${INTERFACE}) | |
23 | set_common_target_properties(BasicPlatform) | |
22 | add_library(Diligent-BasicPlatform STATIC ${SOURCE} ${INTERFACE}) | |
23 | set_common_target_properties(Diligent-BasicPlatform) | |
24 | 24 | |
25 | target_include_directories(BasicPlatform | |
25 | target_include_directories(Diligent-BasicPlatform | |
26 | 26 | PUBLIC |
27 | 27 | interface |
28 | 28 | ) |
29 | 29 | |
30 | target_link_libraries(BasicPlatform | |
30 | target_link_libraries(Diligent-BasicPlatform | |
31 | 31 | PUBLIC |
32 | BuildSettings | |
33 | Primitives | |
32 | Diligent-BuildSettings | |
33 | Diligent-Primitives | |
34 | 34 | ) |
35 | 35 | |
36 | 36 | source_group("src" FILES ${SOURCE}) |
37 | 37 | source_group("interface" FILES ${INTERFACE}) |
38 | 38 | |
39 | set_target_properties(BasicPlatform PROPERTIES | |
40 | FOLDER Core/Platforms | |
39 | set_target_properties(Diligent-BasicPlatform PROPERTIES | |
40 | FOLDER DiligentCore/Platforms | |
41 | 41 | ) |
42 | 42 | |
43 | 43 | |
44 | 44 | if(INSTALL_DILIGENT_CORE) |
45 | install_core_lib(BasicPlatform) | |
46 | get_core_library_relative_dir(BasicPlatform BASIC_PLATFORM_DIR) | |
45 | install_core_lib(Diligent-BasicPlatform) | |
46 | get_core_library_relative_dir(Diligent-BasicPlatform BASIC_PLATFORM_DIR) | |
47 | 47 | install(DIRECTORY "../interface" |
48 | 48 | DESTINATION "${DILIGENT_CORE_INSTALL_DIR}/headers/${BASIC_PLATFORM_DIR}/../" |
49 | 49 | ) |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | add_library(PlatformInterface INTERFACE) | |
2 | add_library(Diligent-PlatformInterface INTERFACE) | |
3 | 3 | |
4 | target_include_directories(PlatformInterface INTERFACE interface) | |
4 | target_include_directories(Diligent-PlatformInterface INTERFACE interface) | |
5 | 5 | |
6 | 6 | set(PLATFORM_INTERFACE_HEADERS |
7 | 7 | ../interface/Atomics.h |
15 | 15 | |
16 | 16 | if(PLATFORM_WIN32) |
17 | 17 | add_subdirectory(Win32) |
18 | add_library(TargetPlatform ALIAS Win32Platform) | |
18 | add_library(Diligent-TargetPlatform ALIAS Diligent-Win32Platform) | |
19 | 19 | elseif(PLATFORM_UNIVERSAL_WINDOWS) |
20 | 20 | add_subdirectory(UWP) |
21 | add_library(TargetPlatform ALIAS UniversalWindowsPlatform) | |
21 | add_library(Diligent-TargetPlatform ALIAS Diligent-UniversalWindowsPlatform) | |
22 | 22 | elseif(PLATFORM_ANDROID) |
23 | 23 | add_subdirectory(Android) |
24 | add_library(TargetPlatform ALIAS AndroidPlatform) | |
24 | add_library(Diligent-TargetPlatform ALIAS Diligent-AndroidPlatform) | |
25 | 25 | elseif(PLATFORM_LINUX) |
26 | 26 | add_subdirectory(Linux) |
27 | add_library(TargetPlatform ALIAS LinuxPlatform) | |
27 | add_library(Diligent-TargetPlatform ALIAS Diligent-LinuxPlatform) | |
28 | 28 | elseif(PLATFORM_MACOS OR PLATFORM_IOS) |
29 | 29 | add_subdirectory(Apple) |
30 | add_library(TargetPlatform ALIAS ApplePlatform) | |
30 | add_library(Diligent-TargetPlatform ALIAS Diligent-ApplePlatform) | |
31 | 31 | else() |
32 | 32 | message(FATAL_ERROR "No PLATFORM_XXX variable defined. Make sure that 'DiligentCore' folder is processed first") |
33 | 33 | endif() |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(LinuxPlatform CXX) | |
2 | project(Diligent-LinuxPlatform CXX) | |
3 | 3 | |
4 | 4 | set(INTERFACE |
5 | 5 | interface/LinuxDebug.h |
13 | 13 | src/LinuxFileSystem.cpp |
14 | 14 | ) |
15 | 15 | |
16 | add_library(LinuxPlatform ${SOURCE} ${INTERFACE} ${PLATFORM_INTERFACE_HEADERS}) | |
17 | set_common_target_properties(LinuxPlatform) | |
16 | add_library(Diligent-LinuxPlatform ${SOURCE} ${INTERFACE} ${PLATFORM_INTERFACE_HEADERS}) | |
17 | set_common_target_properties(Diligent-LinuxPlatform) | |
18 | 18 | |
19 | target_include_directories(LinuxPlatform | |
19 | target_include_directories(Diligent-LinuxPlatform | |
20 | 20 | PUBLIC |
21 | 21 | interface |
22 | 22 | ) |
23 | 23 | |
24 | target_link_libraries(LinuxPlatform | |
24 | target_link_libraries(Diligent-LinuxPlatform | |
25 | 25 | PUBLIC |
26 | BuildSettings | |
27 | BasicPlatform | |
28 | PlatformInterface | |
26 | Diligent-BuildSettings | |
27 | Diligent-BasicPlatform | |
28 | Diligent-PlatformInterface | |
29 | 29 | ) |
30 | 30 | |
31 | 31 | source_group("src" FILES ${SOURCE}) |
32 | 32 | source_group("include" FILES ${INCLUDE}) |
33 | 33 | source_group("interface" FILES ${PLATFORM_INTERFACE_HEADERS}) |
34 | 34 | |
35 | set_target_properties(LinuxPlatform PROPERTIES | |
36 | FOLDER Core/Platforms | |
35 | set_target_properties(Diligent-LinuxPlatform PROPERTIES | |
36 | FOLDER DiligentCore/Platforms | |
37 | 37 | ) |
38 | 38 | |
39 | 39 | if(INSTALL_DILIGENT_CORE) |
40 | install_core_lib(LinuxPlatform) | |
40 | install_core_lib(Diligent-LinuxPlatform) | |
41 | 41 | endif() |
0 | 0 | cmake_minimum_required (VERSION 3.8) |
1 | 1 | |
2 | project(UniversalWindowsPlatform CXX) | |
2 | project(Diligent-UniversalWindowsPlatform CXX) | |
3 | 3 | |
4 | 4 | set(INTERFACE |
5 | 5 | interface/UWPDebug.h |
14 | 14 | ../Win32/src/Win32Atomics.cpp |
15 | 15 | ) |
16 | 16 | |
17 | add_library(UniversalWindowsPlatform ${SOURCE} ${INTERFACE} ${PLATFORM_INTERFACE_HEADERS}) | |
18 | set_common_target_properties(UniversalWindowsPlatform) | |
17 | add_library(Diligent-UniversalWindowsPlatform ${SOURCE} ${INTERFACE} ${PLATFORM_INTERFACE_HEADERS}) | |
18 | set_common_target_properties(Diligent-UniversalWindowsPlatform) | |
19 | 19 | |
20 | target_include_directories(UniversalWindowsPlatform | |
20 | target_include_directories(Diligent-UniversalWindowsPlatform | |
21 | 21 | PUBLIC |
22 | 22 | ../Win32/interface |
23 | 23 | interface |
24 | 24 | ) |
25 | 25 | |
26 | target_link_libraries(UniversalWindowsPlatform | |
26 | target_link_libraries(Diligent-UniversalWindowsPlatform | |
27 | 27 | PUBLIC |
28 | BuildSettings | |
29 | BasicPlatform | |
30 | PlatformInterface | |
28 | Diligent-BuildSettings | |
29 | Diligent-BasicPlatform | |
30 | Diligent-PlatformInterface | |
31 | 31 | ) |
32 | 32 | |
33 | 33 | source_group("src" FILES ${SOURCE}) |
34 | 34 | source_group("include" FILES ${INCLUDE}) |
35 | 35 | source_group("interface" FILES ${PLATFORM_INTERFACE_HEADERS}) |
36 | 36 | |
37 | set_target_properties(UniversalWindowsPlatform PROPERTIES | |
38 | FOLDER Core/Platforms | |
37 | set_target_properties(Diligent-UniversalWindowsPlatform PROPERTIES | |
38 | FOLDER DiligentCore/Platforms | |
39 | 39 | ) |
40 | 40 | |
41 | 41 | if(INSTALL_DILIGENT_CORE) |
42 | install_core_lib(UniversalWindowsPlatform) | |
42 | install_core_lib(Diligent-UniversalWindowsPlatform) | |
43 | 43 | endif() |
15 | 15 | src/Win32FileSystem.cpp |
16 | 16 | ) |
17 | 17 | |
18 | add_library(Win32Platform ${SOURCE} ${INTERFACE} ${PLATFORM_INTERFACE_HEADERS}) | |
19 | set_common_target_properties(Win32Platform) | |
18 | add_library(Diligent-Win32Platform ${SOURCE} ${INTERFACE} ${PLATFORM_INTERFACE_HEADERS}) | |
19 | set_common_target_properties(Diligent-Win32Platform) | |
20 | 20 | |
21 | target_include_directories(Win32Platform | |
21 | target_include_directories(Diligent-Win32Platform | |
22 | 22 | PUBLIC |
23 | 23 | interface |
24 | 24 | ) |
25 | 25 | |
26 | target_link_libraries(Win32Platform | |
26 | target_link_libraries(Diligent-Win32Platform | |
27 | 27 | PUBLIC |
28 | BuildSettings | |
29 | BasicPlatform | |
30 | PlatformInterface | |
28 | Diligent-BuildSettings | |
29 | Diligent-BasicPlatform | |
30 | Diligent-PlatformInterface | |
31 | 31 | PRIVATE |
32 | 32 | Shlwapi.lib |
33 | 33 | ) |
36 | 36 | source_group("include" FILES ${INCLUDE}) |
37 | 37 | source_group("interface" FILES ${PLATFORM_INTERFACE_HEADERS}) |
38 | 38 | |
39 | set_target_properties(Win32Platform PROPERTIES | |
40 | FOLDER Core/Platforms | |
39 | set_target_properties(Diligent-Win32Platform PROPERTIES | |
40 | FOLDER DiligentCore/Platforms | |
41 | 41 | ) |
42 | 42 | |
43 | 43 | if(INSTALL_DILIGENT_CORE) |
44 | install_core_lib(Win32Platform) | |
44 | install_core_lib(Diligent-Win32Platform) | |
45 | 45 | endif()⏎ |
0 | 0 | cmake_minimum_required (VERSION 3.6) |
1 | 1 | |
2 | project(Primitives CXX) | |
2 | project(Diligent-Primitives CXX) | |
3 | 3 | |
4 | 4 | set(SOURCE |
5 | 5 | src/DebugOutput.cpp |
22 | 22 | |
23 | 23 | # This should be an interface library. However, CMake does not show |
24 | 24 | # interface libraries in an IDE, so we have to create a static library instead |
25 | add_library(Primitives STATIC ${INTERFACE} ${SOURCE}) | |
26 | set_common_target_properties(Primitives) | |
25 | add_library(Diligent-Primitives STATIC ${INTERFACE} ${SOURCE}) | |
26 | set_common_target_properties(Diligent-Primitives) | |
27 | 27 | |
28 | target_link_libraries(Primitives | |
28 | target_link_libraries(Diligent-Primitives | |
29 | 29 | PUBLIC |
30 | BuildSettings | |
30 | Diligent-BuildSettings | |
31 | 31 | ) |
32 | 32 | |
33 | target_include_directories(Primitives | |
33 | target_include_directories(Diligent-Primitives | |
34 | 34 | PUBLIC |
35 | 35 | interface |
36 | 36 | ) |
38 | 38 | source_group("interface" FILES ${INTERFACE}) |
39 | 39 | source_group("src" FILES ${SOURCE}) |
40 | 40 | |
41 | set_target_properties(Primitives PROPERTIES | |
42 | FOLDER Core | |
41 | set_target_properties(Diligent-Primitives PROPERTIES | |
42 | FOLDER DiligentCore | |
43 | 43 | ) |
44 | 44 | |
45 | 45 | if(INSTALL_DILIGENT_CORE) |
46 | install_core_lib(Primitives) | |
46 | install_core_lib(Diligent-Primitives) | |
47 | 47 | endif()⏎ |
16 | 16 | * Added `DRAW_FLAG_VERIFY_DRAW_ATTRIBS`, `DRAW_FLAG_VERIFY_RENDER_TARGETS`, and `DRAW_FLAG_VERIFY_ALL` flags (API Version 240022) |
17 | 17 | * `TEXTURE_VIEW_FLAGS` enum and `Flags` member to `TextureViewDesc` structure (API Version 240023) |
18 | 18 | * Added `IShaderResourceVariable::IsBound()` method |
19 | * Added `Diligent-` prefix to project names to avoid name conflicts. | |
19 | 20 | |
20 | 21 | ## v2.4.b |
21 | 22 |