Skip to content

Commit

Permalink
Add tinygltf as a bext component
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Oct 22, 2024
1 parent 2182291 commit 80bc44d
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
61 changes: 61 additions & 0 deletions tinygltf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions tinygltf/tinygltf
Submodule tinygltf added at 116d00
2 changes: 2 additions & 0 deletions tinygltf/tinygltf.deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PATCH

0 comments on commit 80bc44d

Please sign in to comment.