2018-08-29 21:01:06 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO nanomsg/nng
|
2023-12-19 05:26:22 +08:00
|
|
|
REF "v${VERSION}"
|
2024-03-08 14:48:30 +08:00
|
|
|
SHA512 9e97d961da7b24070deb78d0ed0c7bd5b7889d7e4d0934aedcfb512313cc7e8586316391ddc2fe20a0be9695fb1b7fb09760b9246dd1ab1e61a927e807fb10ef
|
2018-08-29 21:01:06 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
2020-09-25 03:25:36 +08:00
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-09-10 12:12:21 +08:00
|
|
|
FEATURES
|
|
|
|
mbedtls NNG_ENABLE_TLS
|
|
|
|
tools NNG_ENABLE_NNGCAT
|
2020-04-24 12:43:37 +08:00
|
|
|
)
|
2018-08-31 18:18:10 +08:00
|
|
|
|
2021-09-10 12:12:21 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-09-25 03:25:36 +08:00
|
|
|
OPTIONS
|
2018-08-29 21:01:06 +08:00
|
|
|
-DNNG_TESTS=OFF
|
2020-09-25 03:25:36 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2018-08-29 21:01:06 +08:00
|
|
|
)
|
|
|
|
|
2021-09-10 12:12:21 +08:00
|
|
|
vcpkg_cmake_install()
|
2018-08-29 21:01:06 +08:00
|
|
|
|
2021-09-10 12:12:21 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/nng)
|
2018-08-29 21:01:06 +08:00
|
|
|
|
2021-09-10 12:12:21 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2018-08-29 21:01:06 +08:00
|
|
|
|
2019-03-05 02:23:14 +08:00
|
|
|
vcpkg_replace_string(
|
2021-09-10 12:12:21 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/include/nng/nng.h"
|
2019-03-05 02:23:14 +08:00
|
|
|
"defined(NNG_SHARED_LIB)"
|
|
|
|
"0 /* defined(NNG_SHARED_LIB) */"
|
|
|
|
)
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
vcpkg_replace_string(
|
2022-05-06 05:23:49 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/include/nng/nng.h"
|
2019-03-05 02:23:14 +08:00
|
|
|
"!defined(NNG_STATIC_LIB)"
|
|
|
|
"1 /* !defined(NNG_STATIC_LIB) */"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
vcpkg_replace_string(
|
2022-05-06 05:23:49 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/include/nng/nng.h"
|
2019-03-05 02:23:14 +08:00
|
|
|
"!defined(NNG_STATIC_LIB)"
|
|
|
|
"0 /* !defined(NNG_STATIC_LIB) */"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-09-25 03:25:36 +08:00
|
|
|
if ("tools" IN_LIST FEATURES)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES nngcat AUTO_CLEAN)
|
|
|
|
endif()
|
|
|
|
|
2023-12-19 05:26:22 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
|
2018-08-29 21:01:06 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|