diff --git a/.gitmodules b/.gitmodules index 1c26c90d..7d7b2151 100644 --- a/.gitmodules +++ b/.gitmodules @@ -317,3 +317,8 @@ url = https://github.com/BRL-CAD/Clipper2.git branch = RELEASE ignore = dirty +[submodule "tinygltf/tinygltf"] + path = tinygltf/tinygltf + url = https://github.com/BRL-CAD/tinygltf.git + branch = release + ignore = dirty diff --git a/dependencies.cmake b/dependencies.cmake index 58e967a2..16f2e5f7 100644 --- a/dependencies.cmake +++ b/dependencies.cmake @@ -214,6 +214,10 @@ add_project(proj GROUPS "GDAL") # https://gdal.org add_project(gdal GROUPS "GDAL") +# tinygltf - tiny glTF library(loader/saver) +# https://github.com/syoyo/tinygltf +add_project(tinygltf GROUPS "BRLCAD") + # pugixml - a light-weight C++ XML processing library # https://pugixml.org/ add_project(pugixml GROUPS "BRLCAD;APPLESEED") diff --git a/tinygltf/CMakeLists.txt b/tinygltf/CMakeLists.txt new file mode 100644 index 00000000..a396717d --- /dev/null +++ b/tinygltf/CMakeLists.txt @@ -0,0 +1,61 @@ +# Decide if we're using tinygltf +cad_enable(TINYGLTF "librt;libgcv") + +unset(ENGEN_BUNDLED CACHE) + +if (NOT ENABLE_TINYGLTF AND NOT DISABLE_TINYGLTF) + + find_package(tinygltf NO_MODULE) + + if (NOT TARGET tinygltf::tinygltf) + set(ENABLE_TINYGLTF "ON" CACHE BOOL "Enable tinygltf build") + endif (NOT TARGET tinygltf::tinygltf) + +endif (NOT ENABLE_TINYGLTF AND NOT DISABLE_TINYGLTF) + +set(ENABLE_TINYGLTF "${ENABLE_TINYGLTF}" CACHE BOOL "Enable tinygltf build") + +# Decision made + +if (ENABLE_TINYGLTF) + + git_submodule_init(tinygltf CMakeLists.txt) + + RegisterDeps(TINYGLTF) + + ExternalProject_Add(TINYGLTF_BLD + URL "${CMAKE_CURRENT_SOURCE_DIR}/tinygltf" + BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} + #PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/tinygltf.patch + CMAKE_ARGS + -DTINYGLTF_BUILD_LOADER_EXAMPLE=OFF + ${BUILD_TYPE_SPECIFIER} + -DBIN_DIR=${BIN_DIR} + -DLIB_DIR=${LIB_DIR} + -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_Fortran_COMPILER=OFF + -DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX} + -DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR} + -DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR} + LOG_CONFIGURE ${EXT_BUILD_QUIET} + LOG_BUILD ${EXT_BUILD_QUIET} + LOG_INSTALL ${EXT_BUILD_QUIET} + LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET} + STEP_TARGETS install + ) + + TargetInstallDeps(TINYGLTF TINYGLTF_DEPENDS) + + set(TINYGLTF_BUNDLED TRUE CACHE BOOL "tinygltf bundle flag") + +endif (ENABLE_TINYGLTF) + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 + diff --git a/tinygltf/tinygltf b/tinygltf/tinygltf new file mode 160000 index 00000000..116d0030 --- /dev/null +++ b/tinygltf/tinygltf @@ -0,0 +1 @@ +Subproject commit 116d0030f9a55151eb1890b7b7131e4c0602de96 diff --git a/tinygltf/tinygltf.deps b/tinygltf/tinygltf.deps new file mode 100644 index 00000000..ecdeab5f --- /dev/null +++ b/tinygltf/tinygltf.deps @@ -0,0 +1,2 @@ +PATCH +