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

CMake: remove external nlohmann_json from INTERFACE_LINK_LIBRARIES target #2780

Merged
merged 1 commit into from
Jul 14, 2021
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
4 changes: 0 additions & 4 deletions src/bin_projsync.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
3 changes: 2 additions & 1 deletion src/lib_proj.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,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 $<BUILD_INTERFACE:nlohmann_json::nlohmann_json>)
endif()

if(TIFF_ENABLED)
Expand Down
8 changes: 0 additions & 8 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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})
Expand Down