2018-08-29 21:01:06 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO nanomsg/nng
|
2020-04-24 12:43:37 +08:00
|
|
|
REF 6ec4107907552db927be8601aed97b5a4b83d33d#version 1.3.0
|
|
|
|
SHA512 28b99d822d7be0348d4e367c2d92cd2bd4a5563806454388ad3c7d9817ef91fa7b4408d15ce4c77ac6a8ad2dd7db173899fdaf7881585282bf57f4c487909be6
|
2018-08-29 21:01:06 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" NNG_STATIC_LIB)
|
|
|
|
|
2020-04-24 12:43:37 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
mbedtls NNG_ENABLE_TLS
|
|
|
|
)
|
2018-08-31 18:18:10 +08:00
|
|
|
|
2018-08-29 21:01:06 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
2020-04-24 12:43:37 +08:00
|
|
|
OPTIONS ${FEATURE_OPTIONS}
|
2018-08-29 21:01:06 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE
|
|
|
|
-DNNG_STATIC_LIB=${NNG_STATIC_LIB}
|
|
|
|
-DNNG_TESTS=OFF
|
|
|
|
-DNNG_ENABLE_NNGCAT=OFF
|
|
|
|
)
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
2019-03-05 02:23:14 +08:00
|
|
|
vcpkg_replace_string(
|
|
|
|
${CURRENT_PACKAGES_DIR}/include/nng/nng.h
|
|
|
|
"defined(NNG_SHARED_LIB)"
|
|
|
|
"0 /* defined(NNG_SHARED_LIB) */"
|
|
|
|
)
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
vcpkg_replace_string(
|
|
|
|
${CURRENT_PACKAGES_DIR}/include/nng/nng.h
|
|
|
|
"!defined(NNG_STATIC_LIB)"
|
|
|
|
"1 /* !defined(NNG_STATIC_LIB) */"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
vcpkg_replace_string(
|
|
|
|
${CURRENT_PACKAGES_DIR}/include/nng/nng.h
|
|
|
|
"!defined(NNG_STATIC_LIB)"
|
|
|
|
"0 /* !defined(NNG_STATIC_LIB) */"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-08-29 21:01:06 +08:00
|
|
|
# Put the licence file where vcpkg expects it
|
2020-02-08 01:35:10 +08:00
|
|
|
configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
|
2018-08-29 21:01:06 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|