CMake: link curl to its dependencies with PRIVATE

The current PUBLIC visibility causes issues for downstream users.
Cf https://github.com/OSGeo/PROJ/pull/3172#issuecomment-1157942986

Reviewed-by: Jakub Zakrzewski
Closes #9125
This commit is contained in:
Even Rouault 2022-07-08 13:30:57 +02:00 committed by Daniel Stenberg
parent 7ac3607584
commit 0525614269
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -95,7 +95,7 @@ if(NOT BUILD_SHARED_LIBS)
set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_COMPILE_DEFINITIONS CURL_STATICLIB)
endif()
target_link_libraries(${LIB_NAME} ${CURL_LIBS})
target_link_libraries(${LIB_NAME} PRIVATE ${CURL_LIBS})
set_target_properties(${LIB_NAME} PROPERTIES
COMPILE_DEFINITIONS BUILDING_LIBCURL