Skip to content

Commit 44fdb92

Browse files
committed
rename cares lib/target name to support conan/vcpkg
1 parent f81b50c commit 44fdb92

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

cmake_modules/Findc-ares.cmake

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
# Try to find c-ares library Once done this will define
1+
#[[ Try to find c-ares library Once done this will define
22
#
3-
# c-ares_FOUND - system has c-ares
4-
# C-ARES_INCLUDE_DIRS - The c-ares include directory
3+
# c-ares_FOUND - system has c-ares
4+
# C-ARES_INCLUDE_DIRS - The c-ares include directory
55
# C-ARES_LIBRARIES - Link these to use c-ares
6-
# c-ares_lib - Imported Targets
6+
# c-ares - Imported Targets
77
#
88
# Copyright (c) 2020 antao <antao2002@gmail.com>
9-
#
9+
#]]
1010

11-
find_path(C-ARES_INCLUDE_DIRS ares.h)
11+
find_path(C-ARES_INCLUDE_DIRS NAMES ares.h)
1212
find_library(C-ARES_LIBRARIES NAMES cares)
1313
if(C-ARES_INCLUDE_DIRS AND C-ARES_LIBRARIES)
14-
add_library(c-ares_lib INTERFACE IMPORTED)
15-
set_target_properties(c-ares_lib
16-
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
17-
"${C-ARES_INCLUDE_DIRS}"
18-
INTERFACE_LINK_LIBRARIES
19-
"${C-ARES_LIBRARIES}")
14+
add_library(c-ares::cares INTERFACE IMPORTED)
15+
set_target_properties(
16+
c-ares::cares
17+
PROPERTIES
18+
INTERFACE_INCLUDE_DIRECTORIES "${C-ARES_INCLUDE_DIRS}" INTERFACE_LINK_LIBRARIES "${C-ARES_LIBRARIES}"
19+
)
2020
endif()
2121

2222
include(FindPackageHandleStandardArgs)
23-
find_package_handle_standard_args(c-ares
24-
DEFAULT_MSG
25-
C-ARES_INCLUDE_DIRS
26-
C-ARES_LIBRARIES)
23+
find_package_handle_standard_args(
24+
c-ares
25+
DEFAULT_MSG
26+
C-ARES_INCLUDE_DIRS
27+
C-ARES_LIBRARIES
28+
)
2729
mark_as_advanced(C-ARES_INCLUDE_DIRS C-ARES_LIBRARIES)

0 commit comments

Comments
 (0)