2018-03-08 04:06:30 +08:00
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
message(FATAL_ERROR "c-ares does not currently support UWP.")
|
|
|
|
endif()
|
|
|
|
|
2017-05-11 06:08:52 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO c-ares/c-ares
|
2019-05-03 08:39:13 +08:00
|
|
|
REF 9f1fdbf5dd633f81352fac0d6bc0d0c4d45be459
|
|
|
|
SHA512 2bb3696e839e37c6f2be4b979ae6d0eab2914d6f0ca043f688e3bb3071d2348cb64424049f019c16bc05d472dd61d5071e865edd229dce023a50f556a1961766
|
2017-05-11 06:08:52 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2018-12-20 03:53:21 +08:00
|
|
|
set(CARES_STATIC 1)
|
|
|
|
set(CARES_SHARED 0)
|
2017-05-11 06:08:52 +08:00
|
|
|
else()
|
2018-12-20 03:53:21 +08:00
|
|
|
set(CARES_STATIC 0)
|
|
|
|
set(CARES_SHARED 1)
|
2017-05-11 06:08:52 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DCARES_STATIC=${CARES_STATIC}
|
|
|
|
-DCARES_SHARED=${CARES_SHARED}
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/c-ares")
|
|
|
|
|
2017-06-10 06:39:32 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2017-05-16 05:11:09 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
else()
|
2017-06-10 06:39:32 +08:00
|
|
|
file(GLOB EXE_FILES
|
|
|
|
"${CURRENT_PACKAGES_DIR}/bin/*.exe"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/bin/*.exe"
|
|
|
|
)
|
|
|
|
if (EXE_FILES)
|
|
|
|
file(REMOVE ${EXE_FILES})
|
|
|
|
endif()
|
2017-05-16 05:11:09 +08:00
|
|
|
endif()
|
2017-05-11 06:08:52 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
|
|
|
# Handle copyright
|
|
|
|
file(COPY ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/c-ares)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/c-ares/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/c-ares/copyright)
|