From c0ac7a2fc1966d76625da4e455f25dfec1422c28 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 29 Nov 2022 21:40:19 +0800 Subject: [PATCH] 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 --- cmake/modules/Findc-ares.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/Findc-ares.cmake b/cmake/modules/Findc-ares.cmake index 1e26c5c1c0f..56311c7c3eb 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" -- 2.39.5