Files
tinygltf/attic/examples/validator/CMakeLists.txt
Syoyo Fujita 5aa461e477 Deprecate legacy v1/v2/v3 C++ API; make v3 C the mainline
Move tiny_gltf.h/.cc, tinygltf_json.h, json.hpp, stb_image*, loader_example.cc,
examples/, wasm/, experimental/, legacy tests and fuzzers under attic/.

TinyGLTF v3 C (tiny_gltf_v3.h/.c + tinygltf_json_c.h) is now the mainline:
- CMakeLists.txt: v3 C tests only, installs only v3 files
- tests/Makefile and Makefile: build/run the v3 C testers
- test_runner.py: verifies v3 C tester output only (no v1 ground truth)
- CI workflows: build and test v3 C only (GCC/Clang/MSVC/Meson/sanitizers)
- README: v3 C quick start, testing, licenses; legacy moved to attic/
2026-07-31 21:42:31 +09:00

54 lines
1.6 KiB
CMake

project(tinygltf-validator CXX)
cmake_minimum_required(VERSION 3.2)
# exe
add_executable(tinygltf-validator
app/tinygltf-validate.cc
src/json-schema.hpp
src/json-schema-draft4.json.cpp
src/json-uri.cpp
src/json-validator.cpp)
target_include_directories(tinygltf-validator
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src)
target_compile_features(tinygltf-validator
PUBLIC
cxx_range_for) # for C++11 - flags
# Enable more compiler warnings, except when using Visual Studio compiler
if(NOT MSVC)
target_compile_options(tinygltf-validator
PUBLIC
-Wall -Wextra)
endif()
target_compile_definitions(tinygltf-validator
PRIVATE
-DJSON_SCHEMA_VALIDATOR_EXPORTS)
# regex with boost if gcc < 4.8 - default is std::regex
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9.0")
find_package(Boost COMPONENTS regex)
if(NOT Boost_FOUND)
message(STATUS "GCC less then 4.9 and boost-regex NOT found - no regex used")
target_compile_definitions(tinygltf-validator PRIVATE -DJSON_SCHEMA_NO_REGEX)
else()
message(STATUS "GCC less then 4.9 and boost-regex FOUND - using boost::regex")
target_compile_definitions(tinygltf-validator PRIVATE -DJSON_SCHEMA_BOOST_REGEX)
target_include_directories(tinygltf-validator PRIVATE ${Boost_INCLUDE_DIRS})
target_link_libraries(tinygltf-validator PRIVATE ${Boost_LIBRARIES})
endif()
endif()
endif()
# test-zone
# enable_testing()
install ( TARGETS
tinygltf-validator
DESTINATION
bin
)