early-access version 2853
This commit is contained in:
36
externals/vcpkg/ports/json-schema-validator/cmake-find-package.patch
vendored
Executable file
36
externals/vcpkg/ports/json-schema-validator/cmake-find-package.patch
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c4cc218..ff2b706 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -8,6 +8,8 @@ cmake_minimum_required(VERSION 3.2)
|
||||
option(BUILD_TESTS "Build tests" ON)
|
||||
option(BUILD_EXAMPLES "Build examples" ON)
|
||||
|
||||
+find_package(nlohmann_json CONFIG REQUIRED)
|
||||
+
|
||||
# the library
|
||||
add_library(nlohmann_json_schema_validator
|
||||
src/json-schema-draft7.json.cpp
|
||||
@@ -34,6 +36,13 @@ set_target_properties(nlohmann_json_schema_validator
|
||||
# because of the dependency to nlohmann_json.
|
||||
set(JSON_VALIDATOR_INSTALL ON)
|
||||
|
||||
+target_link_libraries(
|
||||
+ nlohmann_json_schema_validator
|
||||
+ PUBLIC
|
||||
+ nlohmann_json
|
||||
+ nlohmann_json::nlohmann_json)
|
||||
+
|
||||
+if(0)
|
||||
# here we decice how nlohmann::json is found and used to build this project
|
||||
|
||||
# first, check whether a nlohmann_json::nlohmann_json target exists already
|
||||
@@ -92,7 +101,7 @@ else()
|
||||
set(nlohmann_json_DIR ${JSON_HPP})
|
||||
endif()
|
||||
endif()
|
||||
-
|
||||
+endif()
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
|
||||
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
target_compile_options(nlohmann_json_schema_validator
|
13
externals/vcpkg/ports/json-schema-validator/fix-ambiguous-assignment.patch
vendored
Executable file
13
externals/vcpkg/ports/json-schema-validator/fix-ambiguous-assignment.patch
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/json-validator.cpp b/src/json-validator.cpp
|
||||
index f16f3ef..1f7b615 100644
|
||||
--- a/src/json-validator.cpp
|
||||
+++ b/src/json-validator.cpp
|
||||
@@ -663,7 +663,7 @@ public:
|
||||
#ifndef NO_STD_REGEX
|
||||
attr = sch.find("pattern");
|
||||
if (attr != sch.end()) {
|
||||
- patternString_ = attr.value();
|
||||
+ patternString_ = attr.value().get<std::string>();
|
||||
pattern_ = {true, REGEX_NAMESPACE::regex(attr.value().get<std::string>(),
|
||||
REGEX_NAMESPACE::regex::ECMAScript)};
|
||||
sch.erase(attr);
|
14
externals/vcpkg/ports/json-schema-validator/forward-find-package.patch
vendored
Executable file
14
externals/vcpkg/ports/json-schema-validator/forward-find-package.patch
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
diff --git a/nlohmann_json_schema_validatorConfig.cmake.in b/nlohmann_json_schema_validatorConfig.cmake.in
|
||||
index 6ee0df2..e0315fa 100644
|
||||
--- a/nlohmann_json_schema_validatorConfig.cmake.in
|
||||
+++ b/nlohmann_json_schema_validatorConfig.cmake.in
|
||||
@@ -7,6 +7,9 @@
|
||||
get_filename_component(NLOHMANN_JSON_SCHEMA_VALIDATOR_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
set(NLOHMANN_JSON_SCHEMA_VALIDATOR_INCLUDE_DIRS @CONF_INCLUDE_DIRS@)
|
||||
|
||||
+include(CMakeFindDependencyMacro)
|
||||
+find_dependency(nlohmann_json)
|
||||
+
|
||||
# Our library dependencies (contains definitions for IMPORTED targets)
|
||||
if(NOT TARGET json-schema-validator)
|
||||
include("${NLOHMANN_JSON_SCHEMA_VALIDATOR_CMAKE_DIR}/nlohmann_json_schema_validatorTargets.cmake")
|
30
externals/vcpkg/ports/json-schema-validator/portfile.cmake
vendored
Executable file
30
externals/vcpkg/ports/json-schema-validator/portfile.cmake
vendored
Executable file
@@ -0,0 +1,30 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO pboettch/json-schema-validator
|
||||
REF 27fc1d094503623dfe39365ba82581507524545c
|
||||
SHA512 4fd05087743f43871586a53d119acd1a19d0bdec8a5620f62b6eee7a926d285842e8439127eec52eeb11069c92b8d9af28558897d48e2422ecafca39d9f23cdb
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-ambiguous-assignment.patch
|
||||
cmake-find-package.patch
|
||||
forward-find-package.patch
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DBUILD_TESTS=OFF
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
set(PKG_NAME "nlohmann_json_schema_validator")
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PKG_NAME} TARGET_PATH share/${PKG_NAME})
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||
|
4
externals/vcpkg/ports/json-schema-validator/usage
vendored
Executable file
4
externals/vcpkg/ports/json-schema-validator/usage
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
The package json-schema-validator provides CMake integration:
|
||||
|
||||
find_package(nlohmann_json_schema_validator REQUIRED)
|
||||
target_link_libraries(main PRIVATE nlohmann_json_schema_validator)
|
13
externals/vcpkg/ports/json-schema-validator/vcpkg.json
vendored
Executable file
13
externals/vcpkg/ports/json-schema-validator/vcpkg.json
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "json-schema-validator",
|
||||
"version-string": "2.1.0",
|
||||
"port-version": 1,
|
||||
"description": "This is a C++ library for validating JSON documents based on a JSON Schema. This validator is based on nlohmann json library.",
|
||||
"homepage": "https://github.com/pboettch/json-schema-validator",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "nlohmann-json",
|
||||
"default-features": false
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user