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

40 lines
1.2 KiB
CMake

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
REF 1.1.2
SHA512 e99b1292d6acdefef43b13cb2ad5b5972ed9e65fb3b2b3eacf06486e88f65fdb1e119fd0cf7dadddb1b1dffaef1aa30edda68fa5dc8aa2b22bcdad2d56e1de63
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()