[yajl] Fix #44841: Replace deprecated LOCATION property in CMake (#47039)

This commit is contained in:
A13501350 2025-08-27 16:04:25 +08:00 committed by GitHub
parent 7156a4269b
commit d0acd431d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 40 additions and 3 deletions

View File

@ -34,3 +34,34 @@ index 99cf9e9..454482a 100644
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})
INSTALL(TARGETS yajl_s ARCHIVE DESTINATION lib${LIB_SUFFIX})
diff --git a/verify/CMakeLists.txt b/verify/CMakeLists.txt
index 2f39008..967fca1 100644
--- a/verify/CMakeLists.txt
+++ b/verify/CMakeLists.txt
@@ -29,9 +29,7 @@ ADD_EXECUTABLE(json_verify ${SRCS})
TARGET_LINK_LIBRARIES(json_verify yajl_s)
# copy in the binary
-GET_TARGET_PROPERTY(binPath json_verify LOCATION)
-
ADD_CUSTOM_COMMAND(TARGET json_verify POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${binPath} ${binDir})
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:json_verify> ${binDir})
INSTALL(TARGETS json_verify RUNTIME DESTINATION bin)
diff --git a/reformatter/CMakeLists.txt b/reformatter/CMakeLists.txt
index 52a9bee..267d02e 100644
--- a/reformatter/CMakeLists.txt
+++ b/reformatter/CMakeLists.txt
@@ -35,9 +35,7 @@ IF (NOT WIN32)
ENDIF (NOT WIN32)
# copy the binary into the output directory
-GET_TARGET_PROPERTY(binPath json_reformat LOCATION)
-
ADD_CUSTOM_COMMAND(TARGET json_reformat POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${binPath} ${binDir})
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:json_reformat> ${binDir})
INSTALL(TARGETS json_reformat RUNTIME DESTINATION bin)

View File

@ -4,7 +4,8 @@ vcpkg_from_github(
REF a0ecdde0c042b9256170f2f8890dd9451a4240aa #2.1.0
SHA512 cf0279fdbdc21d07bc0f2d409f1dddb39fd2ad62ab9872e620f46de4753958f8c59e44ef2ee734547f0f25f9490bada8c9e97dcc1a4b14b25d3e7a7254f8e1f3
HEAD_REF master
PATCHES cmake.patch
PATCHES
cmake.patch
)
vcpkg_cmake_configure(

View File

@ -1,7 +1,7 @@
{
"name": "yajl",
"version": "2.1.0",
"port-version": 4,
"port-version": 5,
"description": "Yet Another JSON Library",
"homepage": "https://github.com/lloyd/yajl",
"license": "ISC",

View File

@ -10550,7 +10550,7 @@
},
"yajl": {
"baseline": "2.1.0",
"port-version": 4
"port-version": 5
},
"yalantinglibs": {
"baseline": "0.5.4",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7a607eaa50fbca51dea1b14b5718536d7fd5977e",
"version": "2.1.0",
"port-version": 5
},
{
"git-tree": "3f4f50d7448d28c577777c09895a93847124e1d3",
"version": "2.1.0",