0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-19 19:52:15 +02:00

vcpkg-ports: add patch for jsoncpp

See https://github.com/open-source-parsers/jsoncpp/issues/1356

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
This commit is contained in:
Frank Lichtenheld 2021-11-17 17:59:05 +01:00 committed by David Sommerseth
parent 2996dfbe19
commit b9e0d776fd
No known key found for this signature in database
GPG Key ID: 86CF944C9671FDF2
3 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,33 @@
From 05b0128123e9c1e81522864ba5321ebc62e4c9b8 Mon Sep 17 00:00:00 2001
From: Frank Lichtenheld <frank@lichtenheld.com>
Date: Wed, 17 Nov 2021 17:13:29 +0100
Subject: [PATCH] cmake: protect JsonCpp::JsonCpp against multiple includes
Similar to what we have in jsoncpp-targets.cmake
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
---
jsoncpp-namespaced-targets.cmake | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/jsoncpp-namespaced-targets.cmake b/jsoncpp-namespaced-targets.cmake
index ac1504e..5339403 100644
--- a/jsoncpp-namespaced-targets.cmake
+++ b/jsoncpp-namespaced-targets.cmake
@@ -1,7 +1,11 @@
+if (TARGET JsonCpp::JsonCpp)
+ return()
+endif()
+
if (TARGET jsoncpp_static)
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
elseif (TARGET jsoncpp_lib)
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_lib")
-endif ()
\ No newline at end of file
+endif ()
--
2.30.2

34
deps/vcpkg-ports/jsoncpp/portfile.cmake vendored Normal file
View File

@ -0,0 +1,34 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO open-source-parsers/jsoncpp
REF 1.9.5
SHA512 1d06e044759b1e1a4cc4960189dd7e001a0a4389d7239a6d59295af995a553518e4e0337b4b4b817e70da5d9731a4c98655af90791b6287870b5ff8d73ad8873
HEAD_REF master
PATCHES
"0001-cmake-protect-JsonCpp-JsonCpp-against-multiple-inclu.patch"
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" JSONCPP_STATIC)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_CRT)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DJSONCPP_WITH_CMAKE_PACKAGE=ON
-DBUILD_STATIC_LIBS=${JSONCPP_STATIC}
-DJSONCPP_STATIC_WINDOWS_RUNTIME=${STATIC_CRT}
-DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF
-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF
-DJSONCPP_WITH_TESTS=OFF
-DJSONCPP_WITH_EXAMPLE=OFF
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/jsoncpp)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_copy_pdbs()
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

17
deps/vcpkg-ports/jsoncpp/vcpkg.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"name": "jsoncpp",
"version": "1.9.5",
"port-version": 42,
"description": "jsoncpp is an implementation of a JSON reader and writer in C++. JSON (JavaScript Object Notation) is a lightweight data-interchange format that it is easy to parse and redeable for human.",
"homepage": "https://github.com/open-source-parsers/jsoncpp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}