forked from DiligentGraphics/DiligentTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
76 lines (65 loc) · 2.11 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
cmake_minimum_required (VERSION 3.6)
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()
set_target_properties(Diligent-AssetLoader PROPERTIES
FOLDER DiligentTools
)
if(DILIGENT_INSTALL_TOOLS)
install_tools_lib(Diligent-AssetLoader)
endif()