From 5b8c90c31a066ea9ace99e7874e4fa43f770a1a2 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 23 Feb 2020 18:14:05 -0800 Subject: Updated cmake file to enable draco compression in tiny gltf --- AssetLoader/CMakeLists.txt | 7 +++++++ README.md | 2 ++ 2 files changed, 9 insertions(+) diff --git a/AssetLoader/CMakeLists.txt b/AssetLoader/CMakeLists.txt index 6416c54..1b4a74b 100644 --- a/AssetLoader/CMakeLists.txt +++ b/AssetLoader/CMakeLists.txt @@ -41,6 +41,13 @@ PRIVATE Diligent-TextureLoader ) +if (TARGET draco) + target_link_libraries(Diligent-AssetLoader PRIVATE draco) + target_compile_definitions(Diligent-AssetLoader PRIVATE TINYGLTF_ENABLE_DRACO) + get_target_property(DRACO_SOURCE_DIR draco SOURCE_DIR) + target_include_directories(Diligent-AssetLoader PRIVATE "${DRACO_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}") +endif() + set_target_properties(Diligent-AssetLoader PROPERTIES FOLDER DiligentTools ) diff --git a/README.md b/README.md index 9a4514e..8239cc1 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ and contains the following libraries: * [Texture loader](TextureLoader): a texture loading libary. The following formats are currently supported: jpg, png, tiff, dds, ktx. * [Asset Loader](AssetLoader): an asset loading libary. The library currently supports GLTF 2.0. + * To enable Draco compression, download [Draco repository](https://github.com/google/draco) and include it into + your project. Make sure that Draco source folder is processed by CMake *before* DiligentTools folder. * [Imgui](Imgui): implementation of [dear imgui](https://github.com/ocornut/imgui) with Diligent API. * [NativeApp](NativeApp): implementation of native application on supported platforms. -- cgit v1.2.3