axmol/thirdparty/c-ares/CMakeLists.txt

36 lines
819 B
CMake
Raw Normal View History

2023-12-14 04:49:03 +08:00
set(target_name c-ares)
project(${target_name})
2023-12-15 22:29:23 +08:00
_1kfetch_dist(cares "${PARENT_DIRECTORY}/_deps")
2023-12-14 04:49:03 +08:00
if(WINDOWS)
add_library(${target_name} SHARED IMPORTED GLOBAL)
else()
add_library(${target_name} STATIC IMPORTED GLOBAL)
endif()
set_target_properties(${target_name} PROPERTIES
2023-12-15 22:29:23 +08:00
INTERFACE_INCLUDE_DIRECTORIES "${cares_INC_DIR}"
2023-12-14 04:49:03 +08:00
INTERFACE_COMPILE_DEFINITIONS CARES_STATICLIB=1
)
if (APPLE)
set_target_properties(${target_name} PROPERTIES
INTERFACE_LINK_LIBRARIES resolv
)
endif()
if(WINDOWS)
set_target_properties(${target_name} PROPERTIES
2023-12-15 22:29:23 +08:00
IMPORTED_IMPLIB "${cares_LIB_DIR}/cares.lib"
2023-12-14 04:49:03 +08:00
)
else()
set_target_properties(${target_name} PROPERTIES
2023-12-15 22:29:23 +08:00
IMPORTED_LOCATION "${cares_LIB_DIR}/libcares.a"
2023-12-14 04:49:03 +08:00
)
endif()
2023-12-15 22:29:23 +08:00
set(CARES_INCLUDE_DIR "${cares_INC_DIR}" CACHE STRING "c-ares Include Directory" )