From 21485496b15f944c93ae9085efc3fcea0f84fdce Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 16 Oct 2024 14:56:25 +0200 Subject: [PATCH] CMake: allow opt-out of installing vendored headers --- CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f3dcc3..86ae54a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ option(TINYGLTF_BUILD_VALIDATOR_EXAMPLE "Build validator exampe" OFF) option(TINYGLTF_BUILD_BUILDER_EXAMPLE "Build glTF builder example" OFF) option(TINYGLTF_HEADER_ONLY "On: header-only mode. Off: create tinygltf library(No TINYGLTF_IMPLEMENTATION required in your project)" OFF) option(TINYGLTF_INSTALL "Install tinygltf files during install step. Usually set to OFF if you include tinygltf through add_subdirectory()" ON) +option(TINYGLTF_INSTALL_VENDOR "Install vendored nlohmann/json and nothings/stb headers" ON) if (TINYGLTF_BUILD_LOADER_EXAMPLE) add_executable(loader_example @@ -67,13 +68,20 @@ if (TINYGLTF_INSTALL) # Do not install .lib even if !TINYGLTF_HEADER_ONLY INSTALL ( FILES - json.hpp - stb_image.h - stb_image_write.h tiny_gltf.h ${TINYGLTF_EXTRA_SOUECES} DESTINATION include ) + if(TINYGLTF_INSTALL_VENDOR) + INSTALL ( FILES + json.hpp + stb_image.h + stb_image_write.h + DESTINATION + include + ) + endif() + endif(TINYGLTF_INSTALL)