From: Kefu Chai Date: Tue, 29 Nov 2022 13:40:19 +0000 (+0800) Subject: cmake: add c-ares::cares as a global visible library X-Git-Tag: v18.1.0~716^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c0ac7a2fc1966d76625da4e455f25dfec1422c28;p=ceph.git cmake: add c-ares::cares as a global visible library to address the build failure like: -- Checking for one of the modules 'libcares' CMake Error at cmake/modules/BuildBoost.cmake:287 (_add_library): _add_library cannot create ALIAS target "c-ares::c-ares" because target "c-ares::cares" is imported but not globally visible. Call Stack (most recent call first): cmake/modules/Findc-ares.cmake:31 (add_library) src/CMakeLists.txt:344 (find_package) Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/Findc-ares.cmake b/cmake/modules/Findc-ares.cmake index 1e26c5c1c0fc..56311c7c3eb2 100644 --- a/cmake/modules/Findc-ares.cmake +++ b/cmake/modules/Findc-ares.cmake @@ -22,7 +22,7 @@ find_package_handle_standard_args(c-ares VERSION_VAR c-ares_VERSION) if(c-ares_FOUND AND NOT (TARGET c-ares::cares)) - add_library(c-ares::cares UNKNOWN IMPORTED) + add_library(c-ares::cares UNKNOWN IMPORTED GLOBAL) set_target_properties(c-ares::cares PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${c-ares_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C"