vcpkg/ports/azure-umqtt-c/portfile.cmake

40 lines
1.2 KiB
CMake
Raw Normal View History

include(vcpkg_common_functions)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
message("azure-umqtt-c only supports static linkage")
set(VCPKG_LIBRARY_LINKAGE "static")
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Azure/azure-umqtt-c
2018-06-13 01:32:58 +08:00
REF 1.1.5
SHA512 c72c32f3dcacd5e39094ca244b140dee5da92f85212cece1a7f14e5af05fa6b0af3ba649218aa38b2911f4bda120789fe419f303ad29b7543e039bb5410b58d3
HEAD_REF master
)
file(COPY ${CURRENT_INSTALLED_DIR}/share/azure-c-shared-utility/azure_iot_build_rules.cmake DESTINATION ${SOURCE_PATH}/deps/c-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
-Dbuild_as_dynamic=${BUILD_AS_DYNAMIC}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/umqtt)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL
${SOURCE_PATH}/LICENSE
DESTINATION ${CURRENT_PACKAGES_DIR}/share/azure-umqtt-c RENAME copyright)
vcpkg_copy_pdbs()