-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
90 lines (78 loc) · 2.8 KB
/
CMakeLists.txt
File metadata and controls
90 lines (78 loc) · 2.8 KB
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
cmake_minimum_required (VERSION 3.10)
project(Diligent-AssetLoader CXX)
set(INCLUDE
#include/GLTFLoader.hpp
)
set(INTERFACE
interface/GLTFLoader.hpp
interface/GLTFBuilder.hpp
interface/DXSDKMeshLoader.hpp
interface/GLTFResourceManager.hpp
)
set(SOURCE
src/GLTFLoader.cpp
src/GLTFBuilder.cpp
src/DXSDKMeshLoader.cpp
src/GLTFResourceManager.cpp
)
add_library(Diligent-AssetLoader STATIC ${SOURCE} ${INCLUDE} ${INTERFACE})
set_common_target_properties(Diligent-AssetLoader)
target_include_directories(Diligent-AssetLoader
PUBLIC
interface
PRIVATE
include
)
source_group("source" FILES ${SOURCE})
source_group("include" FILES ${INCLUDE})
source_group("interface" FILES ${INTERFACE})
target_link_libraries(Diligent-AssetLoader
PRIVATE
Diligent-BuildSettings
Diligent-Common
Diligent-PlatformInterface
Diligent-GraphicsEngineInterface
Diligent-GraphicsAccessories
Diligent-GraphicsTools
Diligent-TextureLoader
Diligent-JSON
)
if (TARGET draco OR TARGET draco_static)
if(TARGET draco)
set(DRACO_TARGET draco)
else()
set(DRACO_TARGET draco_static)
endif()
target_link_libraries(Diligent-AssetLoader PRIVATE ${DRACO_TARGET})
get_target_property(DRACO_SOURCE_DIR ${DRACO_TARGET} SOURCE_DIR)
target_compile_definitions(Diligent-AssetLoader PRIVATE TINYGLTF_ENABLE_DRACO)
target_include_directories(Diligent-AssetLoader PRIVATE "${DRACO_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}")
elseif (DRACO_PATH)
find_library(DRACO_LIBRARY NAMES draco draco_static PATHS "${DRACO_PATH}/lib")
if(DRACO_LIBRARY)
target_link_libraries(Diligent-AssetLoader PRIVATE ${DRACO_LIBRARY})
target_include_directories(Diligent-AssetLoader PRIVATE "${DRACO_PATH}/include")
target_compile_definitions(Diligent-AssetLoader PRIVATE TINYGLTF_ENABLE_DRACO)
else()
message(WARNING "Unable to find draco library. Draco support will be disabled")
endif()
endif()
if(DILIGENT_USE_RAPIDJSON)
FetchContent_DeclareShallowGit(
rapidjson
GIT_REPOSITORY https://github.com/Tencent/rapidjson
GIT_TAG ab1842a2dae061284c0a62dca1cc6d5e7e37e346
)
set(RAPIDJSON_BUILD_DOC OFF CACHE BOOL "Do not build documentation")
set(RAPIDJSON_BUILD_EXAMPLES OFF CACHE BOOL "Do not build examples")
set(RAPIDJSON_BUILD_TESTS OFF CACHE BOOL "Do not build tests")
FetchContent_MakeAvailable(rapidjson)
target_include_directories(Diligent-AssetLoader PRIVATE ${rapidjson_SOURCE_DIR}/include/rapidjson)
target_compile_definitions(Diligent-AssetLoader PRIVATE TINYGLTF_USE_RAPIDJSON TINYGLTF_USE_RAPIDJSON_CRTALLOCATOR)
endif()
set_target_properties(Diligent-AssetLoader PROPERTIES
FOLDER DiligentTools
)
if(DILIGENT_INSTALL_TOOLS)
install_tools_lib(Diligent-AssetLoader)
endif()