2018-08-29 21:01:06 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO nanomsg/nng
|
2018-11-17 09:42:31 +08:00
|
|
|
REF v1.1.0
|
|
|
|
SHA512 79f8d66cdf1d8f0f50f888edf59b46671ca7439d1da0f25e5f729bd1365b4bc2969c90a377bbd25c41f84eeb231d03fb0bc7c2d5435e3e55f4cf80ae62f9b934
|
2018-08-29 21:01:06 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" NNG_STATIC_LIB)
|
|
|
|
|
2018-08-31 18:18:10 +08:00
|
|
|
if("mbedtls" IN_LIST FEATURES)
|
|
|
|
set(NNG_ENABLE_TLS ON)
|
|
|
|
else()
|
|
|
|
set(NNG_ENABLE_TLS OFF)
|
|
|
|
endif()
|
|
|
|
|
2018-08-29 21:01:06 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE
|
|
|
|
-DNNG_STATIC_LIB=${NNG_STATIC_LIB}
|
|
|
|
-DNNG_TESTS=OFF
|
|
|
|
-DNNG_ENABLE_NNGCAT=OFF
|
2018-08-31 18:18:10 +08:00
|
|
|
-DNNG_ENABLE_TLS=${NNG_ENABLE_TLS}
|
2018-08-29 21:01:06 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
# Move CMake config files to the right place
|
2018-11-17 09:42:31 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/nng)
|
2018-08-29 21:01:06 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
|
|
|
# Put the licence file where vcpkg expects it
|
2018-11-17 09:42:31 +08:00
|
|
|
configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/nng/copyright COPYONLY)
|
2018-08-29 21:01:06 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|