mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-30 23:39:00 +08:00
55 lines
1.4 KiB
CMake
55 lines
1.4 KiB
CMake
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
message(FATAL_ERROR "c-ares does not currently support UWP.")
|
|
endif()
|
|
|
|
include(vcpkg_common_functions)
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO c-ares/c-ares
|
|
REF cares-1_15_0
|
|
SHA512 3c925e0b3a25f3b656a145966ca763f77ae4ccefd87f2d9ae01cae786eeca0ce8397af4ab21da64f516b4603850638f969056184c310372d22aeb5cbfd2704c8
|
|
HEAD_REF master
|
|
)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
set(CARES_STATIC ON)
|
|
set(CARES_SHARED OFF)
|
|
else()
|
|
set(CARES_STATIC OFF)
|
|
set(CARES_SHARED ON)
|
|
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")
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
else()
|
|
file(GLOB EXE_FILES
|
|
"${CURRENT_PACKAGES_DIR}/bin/*.exe"
|
|
"${CURRENT_PACKAGES_DIR}/debug/bin/*.exe"
|
|
)
|
|
if (EXE_FILES)
|
|
file(REMOVE ${EXE_FILES})
|
|
endif()
|
|
endif()
|
|
|
|
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)
|