vcpkg/ports/azure-iot-sdk-c/portfile.cmake
ewertons 7d2f73d36b Add public-preview version of azure-iot-sdk-c (#5155)
* Add public-preview feature to azure-iot-sdk-c suite of packages

* [azure-c-shared-utility][azure-iot-sdk-c] Remove unneeded repeat dependencies in feature
2019-01-17 13:37:44 -08:00

46 lines
1.5 KiB
CMake

include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
if("public-preview" IN_LIST FEATURES)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Azure/azure-iot-sdk-c
REF 74b03316ec90f1602c20ebeab67a3b4a61065d8e
SHA512 78ab8d7cd6e25886e41f98500cb8cd9609ca677426a882ed0364a908e5267ec6191bb15fd65fb2c420a108df41f52a8ba6d5e6d626874bbfae4f56e8af5ca428
HEAD_REF public-preview
PATCHES improve-external-deps.patch
)
else()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Azure/azure-iot-sdk-c
REF 350b51f5abaedc975dae5419ad1fa4add7635fd2
SHA512 7559768f7d1c67f6b28d16871c3c783e9f88d9dc4f9051a7a3c0329311d39821301edf64fcbde15a8e904c6d5a6326feee25be8e46cb657c21455ae920b266eb
HEAD_REF master
PATCHES improve-external-deps.patch
)
endif()
file(COPY ${CURRENT_INSTALLED_DIR}/share/azure-c-shared-utility/azure_iot_build_rules.cmake DESTINATION ${SOURCE_PATH}/deps/azure-c-shared-utility/configs/)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-Dskip_samples=ON
-Duse_installed_dependencies=ON
-Duse_default_uuid=ON
-Dbuild_as_dynamic=OFF
)
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)
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/azure-iot-sdk-c/copyright COPYONLY)
vcpkg_copy_pdbs()