From ad531900cb6b03c7eccc20b2236c25f305b7709e Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 19 Mar 2026 02:37:10 +0900 Subject: [PATCH] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5238f33..55c9c84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,10 +20,6 @@ option(TINYGLTF_INSTALL "Install tinygltf files during install step. Usually set option(TINYGLTF_INSTALL_VENDOR "Install vendored nlohmann/json and nothings/stb headers" ON) option(TINYGLTF_USE_CUSTOM_JSON "Use the built-in fast JSON parser (tinygltf_json.h) instead of nlohmann/json" OFF) -if (TINYGLTF_USE_CUSTOM_JSON) - add_definitions(-DTINYGLTF_USE_CUSTOM_JSON) -endif (TINYGLTF_USE_CUSTOM_JSON) - if (TINYGLTF_BUILD_LOADER_EXAMPLE) add_executable(loader_example loader_example.cc @@ -76,6 +72,14 @@ else (TINYGLTF_HEADER_ONLY) ) endif (TINYGLTF_HEADER_ONLY) +if (TINYGLTF_USE_CUSTOM_JSON) + if (TINYGLTF_HEADER_ONLY) + target_compile_definitions(tinygltf INTERFACE TINYGLTF_USE_CUSTOM_JSON) + else () + target_compile_definitions(tinygltf PUBLIC TINYGLTF_USE_CUSTOM_JSON) + endif () +endif () + if (TINYGLTF_INSTALL) install(TARGETS tinygltf EXPORT tinygltfTargets) install(EXPORT tinygltfTargets NAMESPACE tinygltf:: FILE TinyGLTFTargets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tinygltf)