- Fix issues with Conanfile - create a package which can be consumed by
downstream Conan packages
- TODO: Add standard Conan workflow instructions to README
During the configuring of json-schema-validator, the repository
nlohmann_json is fetched via the fetch_content functionality of CMake.
It is a huge repository with size 180MB, which are downloaded whenever
one configures CMake on an empty build directory (e.g. after deleting the
build directory to clear out cached CMake variables.)
The repository
https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent
only contains releases instead of all development commits and has
(at the moment) size of only 830kB, which stronly cuts the download time.
* Remove travis file
* Apply pre-commit fixes
* Modernize cmake file
- Added JSON_VALIDATOR_SHARED_LIBS to properly handle shared-library
- Bumped minimum cmake to 3.11 to use no-source add_library
- Bumped minimum cmake to 3.14 to properly support FetchContent (FetchContent_MakeAvailable)
- Converted Hunter package manager to FetchContent (It is plenty mature these days)
- Added namespace to exported target
- Made the cmake file compatible with FetchContent
* Use simplified FetchContent CI
* Add simple status messages
* Handle nlohmann dependency
Not an ideal approach, but required in order for the exported target to have appropriate linkage.
Maybe this can be designed to become a PRIVATE link library, but then how does it ensure the target is installed?
* Remove CMake-install test
This will be moved to packaging integration tests
* Enable code coverage
* Reconfigure ci presets
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Uses json patch format for defaults: json patch (RFC 6902) makes it
clearer in case of array contents. It is supported by nlohmann::json and
can be applied with `patch` to fill up the json with defaults.
Now when json-schema-validator is installed CMake config files are installed in the lib/cmake/json-schema-validator directory.
The install json-schema-validatorTargets.cmake file properly imports the json-hpp and json-schema-validator libraries.
The install json-schema-validatorConfig.cmake file is used by CMake find_package function to include the json-schema-validatorTargets.cmake file and to set the variable JSON_SCHEMA_VALIDATOR_INCLUDE_DIRS to the install include directory.
To use find_package to find the json-schema-validator simply include.
A new test (test_cmake_install) has been added.
When NLohmann's JSON is install with CMake, it follows a certain
naming convention.
As we learned to do proper CMake-install thanks to @lkersting's work
this project now adapts to the way NLohmann is doing it. Namely:
- json-schema.hpp is now located (and installed)
in a nlohmann/-subdirectory
- the CMake library and project's name is now
nlohmann_json_schema_validator
Instead of doing non-standard acrobatics to find the json.hpp
now find_package is used in order to find NLohmann's package
Co-Authored-By: Patrick Boettcher <p@yai.se>
Schema a now "parsed" into C++-validator-objects in a first
step and then validation takes place with these objects.
Errors are now handled via a user-provided error-handler
allowing the user to collect all errors at once or bail out
when a certain threshold is reached. Fixes#36 and #8.
One (sub-)schema can now be referenced with different URIs. Fixes#9
JSON schema draft 7 is now supported. Fixes#35
Description:
- Adds support for the following CMake options:
- BUILD_TESTS (default: ON)
- BUILD_EXAMPLES (default: ON)
- CMAKE_INSTALL_PREFIX (both static and shared)
* Build on Windows using Visual Studio and export symbols from DLL
* Fix two warnings on raised by Visual Studio 2015 compiler + disable -Wall and -Wextra when using Visual Studio compiler
* Fix indentation (TAB instead of spaces)