[nng] Add new package

This commit is contained in:
myd7349 2018-08-29 21:01:06 +08:00
parent 0c5b3ae225
commit 2756b092cf
3 changed files with 61 additions and 0 deletions

3
ports/nng/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: nng
Version: 1.0.1
Description: NNG, like its predecessors nanomsg (and to some extent ZeroMQ), is a lightweight, broker-less library, offering a simple API to solve common recurring messaging problems, such as publish/subscribe, RPC-style request/reply, or service discovery.

View File

@ -0,0 +1,14 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e59ee5b..b5f6a0d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -238,6 +238,9 @@ set_target_properties (${PROJECT_NAME} ${PROJECT_NAME}
target_link_libraries (${PROJECT_NAME} PRIVATE ${NNG_REQUIRED_LIBRARIES})
target_link_libraries (${PROJECT_NAME} PRIVATE Threads::Threads)
+# See: https://github.com/nanomsg/nanomsg/pull/949/
+target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
+
install (TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-target
FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library

44
ports/nng/portfile.cmake Normal file
View File

@ -0,0 +1,44 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO nanomsg/nng
REF ce9f0cb155ad0e97cfc7703d9d7c8e5bec3201bc
SHA512 e1fca685e3397398bd259d126560902e813d1e2fb5cdb04de9d3f2fd74961f53af53dbaf9a555113a5588f07a3859d16bdc64f0a0ff65a7b5cf89965e764e68d
HEAD_REF master
PATCHES fix-include-path.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" NNG_STATIC_LIB)
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
)
vcpkg_install_cmake()
# Move CMake config files to the right place
if(EXISTS ${CURRENT_PACKAGES_DIR}/cmake)
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
endif()
if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/nng)
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/nng)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Put the licence file where vcpkg expects it
file(COPY
${SOURCE_PATH}/LICENSE.txt
DESTINATION ${CURRENT_PACKAGES_DIR}/share/nng)
file(RENAME
${CURRENT_PACKAGES_DIR}/share/nng/LICENSE.txt
${CURRENT_PACKAGES_DIR}/share/nng/copyright)
vcpkg_copy_pdbs()