Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ include(CMakeDependentOption)
option(WITH_ASSIMPIMPORTER "Build AssimpImporter plugin" OFF)
option(WITH_BASISIMAGECONVERTER "Build BasisImageConverter plugin" OFF)
option(WITH_BASISIMPORTER "Build BasisImporter plugin" OFF)
option(WITH_CGLTFIMPORTER "Build CgltfImporter plugin" OFF)
option(WITH_DDSIMPORTER "Build DdsImporter plugin" OFF)
option(WITH_DEVILIMAGEIMPORTER "Build DevIlImageImporter plugin" OFF)
option(WITH_DRFLACAUDIOIMPORTER "Build DrFlacAudioImporter plugin" OFF)
Expand Down
2 changes: 2 additions & 0 deletions doc/building-plugins.dox
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ By default no plugins are built and you need to select them manually:
--- if you are on Vcpkg, it will "just work", otherwise you need to
download the sources and point `BASIS_UNIVERSAL_DIR` to their directory so
CMake can find them.
- `WITH_CGLTFIMPORTER` --- Build the
@ref Trade::CgltfImporter "CgltfImporter" plugin.
- `WITH_DDSIMPORTER` --- Build the @ref Trade::DdsImporter "DdsImporter"
plugin.
- `WITH_DEVILIMAGEIMPORTER` --- Build the
Expand Down
1 change: 1 addition & 0 deletions doc/cmake-plugins.dox
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ This command will not try to find any actual plugin. The plugins are:
- `AssimpImporter` --- @ref Trade::AssimpImporter "AssimpImporter" plugin
- `BasisImageConverter` --- @ref Trade::BasisImageConverter "BasisImageConverter" plugin
- `BasisImporter` --- @ref Trade::BasisImporter "BasisImporter" plugin
- `CgltfImporter` --- @ref Trade::CgltfImporter "CgltfImporter" plugin
- `DdsImporter` --- @ref Trade::DdsImporter "DdsImporter" plugin
- `DevIlImageImporter` --- @ref Trade::DevIlImageImporter "DevIlImageImporter"
plugin
Expand Down
4 changes: 4 additions & 0 deletions doc/namespaces.dox
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
* @brief Plugin @ref Magnum::Trade::BasisImporter
* @m_since_{plugins,2019,10}
*/
/** @dir MagnumPlugins/CgltfImporter
* @brief Plugin @ref Magnum::Trade::CgltfImporter
* @m_since_latest_{plugins}
*/
/** @dir MagnumPlugins/DdsImporter
* @brief Plugin @ref Magnum::Trade::DdsImporter
*/
Expand Down
2 changes: 2 additions & 0 deletions modules/FindMagnumPlugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# AssimpImporter - Assimp importer
# BasisImageConverter - Basis image converter
# BasisImporter - Basis importer
# CgltfImporter - GLTF importer using cgltf
# DdsImporter - DDS importer
# DevIlImageImporter - Image importer using DevIL
# DrFlacAudioImporter - FLAC audio importer using dr_flac
Expand Down Expand Up @@ -316,6 +317,7 @@ foreach(_component ${MagnumPlugins_FIND_COMPONENTS})
INTERFACE_LINK_LIBRARIES basisu_transcoder)
endif()

# CgltfImporter has no dependencies
# DdsImporter has no dependencies

# DevIlImageImporter plugin dependencies
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_BASISIMPORTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/PKGBUILD-android-arm64
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ build() {
-DWITH_ASSIMPIMPORTER=OFF \
-DWITH_BASISIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=OFF \
-DWITH_DRFLACAUDIOIMPORTER=OFF \
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/PKGBUILD-clang
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/PKGBUILD-clang-addresssanitizer
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/PKGBUILD-clang-threadsanitizer
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/PKGBUILD-coverage
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/PKGBUILD-emscripten
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ build() {
-DWITH_ASSIMPIMPORTER=OFF \
-DWITH_BASISIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=OFF \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=OFF \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/PKGBUILD-emscripten-wasm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ build() {
-DBASIS_UNIVERSAL_DIR=/opt/basis-universal \
-DWITH_BASISIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=OFF \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=OFF \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/PKGBUILD-emscripten-wasm-webgl2
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ build() {
-DBASIS_UNIVERSAL_DIR=/home/mosra/Code/basis_universal \
-DWITH_BASISIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=OFF \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=OFF \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/PKGBUILD-gcc48
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
2 changes: 2 additions & 0 deletions package/archlinux/PKGBUILD-mingw-w64
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=OFF \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=OFF \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down Expand Up @@ -73,6 +74,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=OFF \
-DWITH_BASISIMPORTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=OFF \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
2 changes: 2 additions & 0 deletions package/archlinux/PKGBUILD-release
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down Expand Up @@ -72,6 +73,7 @@ build() {
-DBUILD_GL_TESTS=ON \
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMPORTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/magnum-plugins-git/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_BASISIMPORTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/archlinux/magnum-plugins/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_BASISIMPORTER=ON \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/ci/appveyor-desktop-mingw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ cmake .. ^
-DWITH_ASSIMPIMPORTER=ON ^
-DWITH_BASISIMAGECONVERTER=ON ^
-DWITH_BASISIMPORTER=ON -DBASIS_UNIVERSAL_DIR=%APPVEYOR_BUILD_FOLDER%/basis_universal ^
-DWITH_CGLTFIMPORTER=ON ^
-DWITH_DDSIMPORTER=ON ^
-DWITH_DEVILIMAGEIMPORTER=ON ^
-DWITH_DRFLACAUDIOIMPORTER=ON ^
Expand Down
1 change: 1 addition & 0 deletions package/ci/appveyor-desktop.bat
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ cmake .. ^
-DWITH_ASSIMPIMPORTER=%EXCEPT_MSVC2015% ^
-DWITH_BASISIMAGECONVERTER=ON ^
-DWITH_BASISIMPORTER=ON -DBASIS_UNIVERSAL_DIR=%APPVEYOR_BUILD_FOLDER%/basis_universal ^
-DWITH_CGLTFIMPORTER=ON ^
-DWITH_DDSIMPORTER=ON ^
-DWITH_DEVILIMAGEIMPORTER=ON ^
-DWITH_DRFLACAUDIOIMPORTER=ON ^
Expand Down
1 change: 1 addition & 0 deletions package/ci/appveyor-rt.bat
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ cmake .. ^
-DWITH_ASSIMPIMPORTER=OFF ^
-DWITH_BASISIMAGECONVERTER=ON ^
-DWITH_BASISIMPORTER=ON -DBASIS_UNIVERSAL_DIR=%APPVEYOR_BUILD_FOLDER%/basis_universal ^
-DWITH_CGLTFIMPORTER=ON ^
-DWITH_DDSIMPORTER=ON ^
-DWITH_DEVILIMAGEIMPORTER=OFF ^
-DWITH_DRFLACAUDIOIMPORTER=OFF ^
Expand Down
1 change: 1 addition & 0 deletions package/ci/emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ cmake .. \
-DWITH_ASSIMPIMPORTER=OFF \
-DWITH_BASISIMAGECONVERTER=OFF \
-DWITH_BASISIMPORTER=ON -DBASIS_UNIVERSAL_DIR=$HOME/basis_universal \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=OFF \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/ci/travis-android-arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ cmake .. \
-DWITH_ASSIMPIMPORTER=OFF \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_BASISIMPORTER=ON -DBASIS_UNIVERSAL_DIR=$HOME/basis_universal \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=OFF \
-DWITH_DRMP3AUDIOIMPORTER=OFF \
Expand Down
1 change: 1 addition & 0 deletions package/ci/travis-ios-simulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ cmake .. \
-DWITH_ASSIMPIMPORTER=OFF \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_BASISIMPORTER=ON -DBASIS_UNIVERSAL_DIR=$HOME/basis_universal \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=OFF \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/ci/unix-desktop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ cmake .. \
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=ON \
-DWITH_BASISIMPORTER=ON -DBASIS_UNIVERSAL_DIR=$HOME/basis_universal \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ override_dh_auto_configure:
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=OFF \
-DWITH_BASISIMPORTER=OFF \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ src_configure() {
-DWITH_ASSIMPIMPORTER=ON
-DWITH_BASISIMAGECONVERTER=OFF
-DWITH_BASISIMPORTER=OFF
-DWITH_CGLTFIMPORTER=ON
-DWITH_DDSIMPORTER=ON
-DWITH_DEVILIMAGEIMPORTER=ON
-DWITH_DRFLACAUDIOIMPORTER=ON
Expand Down
1 change: 1 addition & 0 deletions package/homebrew/magnum-plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def install
"-DWITH_ASSIMPIMPORTER=#{(build.with? 'assimp') ? 'ON' : 'OFF'}",
"-DWITH_BASISIMAGECONVERTER=ON",
"-DWITH_BASISIMPORTER=ON",
"-DWITH_CGLTFIMPORTER=ON",
"-DWITH_DDSIMPORTER=ON",
"-DWITH_DEVILIMAGEIMPORTER=#{(build.with? 'devil') ? 'ON' : 'OFF'}",
"-DWITH_DRFLACAUDIOIMPORTER=ON",
Expand Down
1 change: 1 addition & 0 deletions package/msys/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=OFF \
-DWITH_BASISIMPORTER=OFF \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
1 change: 1 addition & 0 deletions package/msys/magnum-plugins/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ build() {
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_BASISIMAGECONVERTER=OFF \
-DWITH_BASISIMPORTER=OFF \
-DWITH_CGLTFIMPORTER=ON \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
-DWITH_DRFLACAUDIOIMPORTER=ON \
Expand Down
4 changes: 4 additions & 0 deletions src/MagnumPlugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ if(WITH_BASISIMPORTER)
add_subdirectory(BasisImporter)
endif()

if(WITH_CGLTFIMPORTER)
add_subdirectory(CgltfImporter)
endif()

if(WITH_DDSIMPORTER)
add_subdirectory(DdsImporter)
endif()
Expand Down
79 changes: 79 additions & 0 deletions src/MagnumPlugins/CgltfImporter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#
# This file is part of Magnum.
#
# Copyright 漏 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
# 2020, 2021 Vladim铆r Vondru拧 <mosra@centrum.cz>
# Copyright 漏 2021 Pablo Escobar <mail@rvrs.in>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#

find_package(Magnum REQUIRED Trade AnyImageImporter)

if(BUILD_PLUGINS_STATIC AND NOT DEFINED MAGNUM_CGLTFIMPORTER_BUILD_STATIC)
set(MAGNUM_CGLTFIMPORTER_BUILD_STATIC 1)
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/configure.h)

# CgltfImporter plugin
add_plugin(CgltfImporter
"${MAGNUM_PLUGINS_IMPORTER_DEBUG_BINARY_INSTALL_DIR};${MAGNUM_PLUGINS_IMPORTER_DEBUG_LIBRARY_INSTALL_DIR}"
"${MAGNUM_PLUGINS_IMPORTER_RELEASE_BINARY_INSTALL_DIR};${MAGNUM_PLUGINS_IMPORTER_RELEASE_LIBRARY_INSTALL_DIR}"
CgltfImporter.conf
CgltfImporter.cpp
CgltfImporter.h)
if(MAGNUM_CGLTFIMPORTER_BUILD_STATIC AND BUILD_STATIC_PIC)
set_target_properties(CgltfImporter PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()
target_include_directories(CgltfImporter PUBLIC
${PROJECT_SOURCE_DIR}/src
${PROJECT_BINARY_DIR}/src)
# Include the files as a system directory to supress warnings
target_include_directories(CgltfImporter SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/src/external/cgltf)
target_link_libraries(CgltfImporter PUBLIC Magnum::Trade)
if(CORRADE_TARGET_WINDOWS)
target_link_libraries(CgltfImporter PUBLIC Magnum::AnyImageImporter)
elseif(MAGNUM_CGLTFIMPORTER_BUILD_STATIC)
target_link_libraries(CgltfImporter INTERFACE Magnum::AnyImageImporter)
endif()
# Modify output location only if all are set, otherwise it makes no sense
if(CMAKE_RUNTIME_OUTPUT_DIRECTORY AND CMAKE_LIBRARY_OUTPUT_DIRECTORY AND CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set_target_properties(CgltfImporter PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/magnum$<$<CONFIG:Debug>:-d>/importers
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$<CONFIG:Debug>:-d>/importers
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$<CONFIG:Debug>:-d>/importers)
endif()

install(FILES CgltfImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h
DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/CgltfImporter)

# Automatic static plugin import
if(MAGNUM_CGLTFIMPORTER_BUILD_STATIC)
install(FILES importStaticPlugin.cpp DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/CgltfImporter)
target_sources(CgltfImporter INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/importStaticPlugin.cpp)
endif()

if(BUILD_TESTS)
add_subdirectory(Test)
endif()

# MagnumPlugins CgltfImporter target alias for superprojects
add_library(MagnumPlugins::CgltfImporter ALIAS CgltfImporter)
Loading