Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsoncpp] Fix repeated find_package #40548

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ports/jsoncpp/cmake-target.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/jsoncpp-namespaced-targets.cmake b/jsoncpp-namespaced-targets.cmake
index ac1504e..144f086 100644
--- a/jsoncpp-namespaced-targets.cmake
+++ b/jsoncpp-namespaced-targets.cmake
@@ -1,7 +1,9 @@
+if (NOT TARGET JsonCpp::JsonCpp)
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 ()
endif ()
\ No newline at end of file
2 changes: 2 additions & 0 deletions ports/jsoncpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ vcpkg_from_github(
REF "${VERSION}"
SHA512 1d06e044759b1e1a4cc4960189dd7e001a0a4389d7239a6d59295af995a553518e4e0337b4b4b817e70da5d9731a4c98655af90791b6287870b5ff8d73ad8873
HEAD_REF master
PATCHES
cmake-target.diff
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" JSONCPP_STATIC)
Expand Down
2 changes: 1 addition & 1 deletion ports/jsoncpp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jsoncpp",
"version": "1.9.5",
"port-version": 4,
"port-version": 5,
"description": "JsonCpp is a C++ library that allows manipulating JSON values, including serialization and deserialization to and from strings. It can also preserve existing comment in unserialization/serialization steps, making it a convenient format to store user input files.",
"homepage": "https://github.com/open-source-parsers/jsoncpp",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3838,7 +3838,7 @@
},
"jsoncpp": {
"baseline": "1.9.5",
"port-version": 4
"port-version": 5
},
"jsonifier": {
"baseline": "0.9.96",
Expand Down
5 changes: 5 additions & 0 deletions versions/j-/jsoncpp.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "176576512ab0d4bb4093ae4f404535a594a1a201",
"version": "1.9.5",
"port-version": 5
},
{
"git-tree": "4f722023370407388c3014d52fee17dbe8d65cc3",
"version": "1.9.5",
Expand Down