vcpkg/ports/nng/portfile.cmake
myd7349 b74d9b2519
[nng] Update to v1.5.1 (#19478)
* [nng] Update to v1.5.1

* [nng] Bump version

* [nng] Quote source path

* [nng] Bump version
2021-09-09 21:12:21 -07:00

56 lines
1.4 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO nanomsg/nng
REF 9fcf039b573d153ba9bbc2beb5f11259ddacdcff # v1.5.1
SHA512 3db2668c3f971dc54156df2a3520645224fbb55460957da35940889c3148cb2cbc67c10cd23b9614ece70235d1f6003618310129eb9c40ced42db058c140dd58
HEAD_REF master
)
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
mbedtls NNG_ENABLE_TLS
tools NNG_ENABLE_NNGCAT
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DNNG_TESTS=OFF
${FEATURE_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/nng)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
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()
if ("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES nngcat AUTO_CLEAN)
endif()
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_copy_pdbs()