mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 08:28:59 +08:00
48 lines
1.4 KiB
CMake
48 lines
1.4 KiB
CMake
include(vcpkg_common_functions)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
message("azure-iot-sdk-c only supports static linkage")
|
|
set(VCPKG_LIBRARY_LINKAGE "static")
|
|
endif()
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO Azure/azure-iot-sdk-c
|
|
REF 1.2.3
|
|
SHA512 6192d454bb2ecb01989f7636751acd6919021b55b772f4ea25a6d0ddd263e7f988275f7fb0b1c304d4ebd30418c9f870eb1c504a4a504f2faeb712ef8e669d5a
|
|
HEAD_REF master
|
|
)
|
|
|
|
vcpkg_apply_patches(
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
PATCHES
|
|
${CMAKE_CURRENT_LIST_DIR}/improve-external-deps.patch
|
|
${CMAKE_CURRENT_LIST_DIR}/improve-external-deps-2.patch
|
|
)
|
|
|
|
file(COPY ${CURRENT_INSTALLED_DIR}/share/azure-c-shared-utility/azure_iot_build_rules.cmake DESTINATION ${SOURCE_PATH}/deps/azure-c-shared-utility/configs/)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_AS_DYNAMIC)
|
|
|
|
vcpkg_configure_cmake(
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
PREFER_NINJA
|
|
OPTIONS
|
|
-Dskip_samples=ON
|
|
-Duse_installed_dependencies=ON
|
|
-Duse_default_uuid=ON
|
|
-Dbuild_as_dynamic=${BUILD_AS_DYNAMIC}
|
|
)
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/azure_iot_sdks)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
|
|
file(INSTALL
|
|
${SOURCE_PATH}/LICENSE
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/share/azure-iot-sdk-c RENAME copyright)
|
|
|
|
vcpkg_copy_pdbs()
|