From 1cb0b8021f0640717356feaff38f99dd8cb9d26e Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 14 Jul 2021 15:01:32 +0200 Subject: [PATCH] Merge pull request #2780 from mwtoews/nlohmann_json_interface_lib CMake: remove external nlohmann_json from INTERFACE_LINK_LIBRARIES target --- src/bin_projsync.cmake | 4 ---- src/lib_proj.cmake | 3 ++- test/unit/CMakeLists.txt | 8 -------- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/bin_projsync.cmake b/src/bin_projsync.cmake index c184a4227e..6486b5d447 100644 --- a/src/bin_projsync.cmake +++ b/src/bin_projsync.cmake @@ -8,10 +8,6 @@ set_target_properties(bin_projsync OUTPUT_NAME projsync) target_link_libraries(bin_projsync PRIVATE ${PROJ_LIBRARIES}) target_compile_options(bin_projsync PRIVATE ${PROJ_CXX_WARN_FLAGS}) -if(NLOHMANN_JSON STREQUAL "external") - target_compile_definitions(bin_projsync PRIVATE EXTERNAL_NLOHMANN_JSON) - target_link_libraries(bin_projsync PRIVATE nlohmann_json::nlohmann_json) -endif() install(TARGETS bin_projsync DESTINATION ${BINDIR}) diff --git a/src/lib_proj.cmake b/src/lib_proj.cmake index 71468c8768..f2de1c1026 100644 --- a/src/lib_proj.cmake +++ b/src/lib_proj.cmake @@ -398,7 +398,8 @@ target_link_libraries(proj PRIVATE ${SQLITE3_LIBRARY}) if(NLOHMANN_JSON STREQUAL "external") target_compile_definitions(proj PRIVATE EXTERNAL_NLOHMANN_JSON) - target_link_libraries(proj PRIVATE nlohmann_json::nlohmann_json) + target_link_libraries(proj + PRIVATE $) endif() if(TIFF_ENABLED) diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 53a14cedc8..1a080ac506 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -166,10 +166,6 @@ add_executable(test_defmodel target_link_libraries(test_defmodel PRIVATE GTest::gtest PRIVATE ${PROJ_LIBRARIES}) -if(NLOHMANN_JSON STREQUAL "external") - target_compile_definitions(test_defmodel PRIVATE EXTERNAL_NLOHMANN_JSON) - target_link_libraries(test_defmodel PRIVATE nlohmann_json::nlohmann_json) -endif() add_test(NAME test_defmodel COMMAND test_defmodel) set_property(TEST test_defmodel PROPERTY ENVIRONMENT ${PROJ_TEST_ENVIRONMENT}) @@ -180,10 +176,6 @@ add_executable(test_tinshift target_link_libraries(test_tinshift PRIVATE GTest::gtest PRIVATE ${PROJ_LIBRARIES}) -if(NLOHMANN_JSON STREQUAL "external") - target_compile_definitions(test_tinshift PRIVATE EXTERNAL_NLOHMANN_JSON) - target_link_libraries(test_tinshift PRIVATE nlohmann_json::nlohmann_json) -endif() add_test(NAME test_tinshift COMMAND test_tinshift) set_property(TEST test_tinshift PROPERTY ENVIRONMENT ${PROJ_TEST_ENVIRONMENT})