mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-17 14:57:55 +08:00
9e04e513b3
Co-authored-by: Jon <v-zhli17@microsoft.com>
56 lines
1.3 KiB
CMake
56 lines
1.3 KiB
CMake
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO nanomsg/nng
|
|
REF "v${VERSION}"
|
|
SHA512 a47f9a0c93a1f12abbe3199e8c3fd8c78c04bea5b049e80d2f03280bc5e58cfdb09ff92a392b71cdf5ec3f859237e12436936d576e5f81ae0937792373168884
|
|
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()
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
|
|
|
|
vcpkg_copy_pdbs()
|