From: Rudi Heitbaum Date: Fri, 28 Mar 2025 09:31:40 +0000 Origin: https://github.com/lloyd/yajl/pull/256/commits/6fe59ca50dfd65bdb3d1c87a27245b2dd1a072f9 Bug: https://github.com/lloyd/yajl/issues/254 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1113652 Description: [PATCH] Allow build with CMake 4.0.0 . fixes deprecated cmake option and uses cmake 2.8.0 TARGET_FILE update cmake supported minimum versions to 2.8.0...3.10 . ref: - https://cmake.org/cmake/help/latest/policy/CMP0026.html . CMake Error at .../CMakeLists.txt: (GET_TARGET_PROPERTY): The LOCATION property may not be read from target "json_...". Use the target name directly with add_custom_command, or use the generator expression $, as appropriate. . Signed-off-by: Rudi Heitbaum --- CMakeLists.txt | 2 +- reformatter/CMakeLists.txt | 4 +--- verify/CMakeLists.txt | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) Index: yajl-2.1.0/CMakeLists.txt =================================================================== --- yajl-2.1.0.orig/CMakeLists.txt +++ yajl-2.1.0/CMakeLists.txt @@ -12,7 +12,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0...3.10) PROJECT(YetAnotherJSONParser C) Index: yajl-2.1.0/reformatter/CMakeLists.txt =================================================================== --- yajl-2.1.0.orig/reformatter/CMakeLists.txt +++ yajl-2.1.0/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 $ ${binDir}) INSTALL(TARGETS json_reformat RUNTIME DESTINATION bin) Index: yajl-2.1.0/verify/CMakeLists.txt =================================================================== --- yajl-2.1.0.orig/verify/CMakeLists.txt +++ yajl-2.1.0/verify/CMakeLists.txt @@ -29,9 +29,7 @@ ADD_EXECUTABLE(json_verify ${SRCS}) TARGET_LINK_LIBRARIES(json_verify yajl) # 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 $ ${binDir}) INSTALL(TARGETS json_verify RUNTIME DESTINATION bin)