-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Source: zyre | ||
Version: 2019-07-07 | ||
Build-Depends: czmq | ||
Description: An open-source framework for proximity-based peer-to-peer applications | ||
Homepage: https://github.com/zeromq/zyre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include(CMakeFindDependencyMacro) | ||
|
||
find_dependency(ZeroMQ) | ||
find_dependency(czmq) | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") | ||
check_required_components("@PROJECT_NAME@") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
find_path(CZMQ_INCLUDE_DIRS NAMES czmq.h) | ||
|
||
find_package(czmq CONFIG REQUIRED) | ||
set(CZMQ_LIBRARIES czmq czmq-static) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args( | ||
CZMQ | ||
REQUIRED_VARS CZMQ_INCLUDE_DIRS CZMQ_LIBRARIES | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
find_package(ZeroMQ CONFIG REQUIRED) | ||
|
||
set(LIBZMQ_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIR}) | ||
set(LIBZMQ_LIBRARIES libzmq libzmq-static) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args( | ||
LIBZMQ | ||
REQUIRED_VARS LIBZMQ_LIBRARIES LIBZMQ_INCLUDE_DIRS | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
include(vcpkg_common_functions) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO zeromq/zyre | ||
REF 2648b7eb806a2494d6eb4177f0941232d83c5294 | ||
SHA512 8940e82ccdc427734711d63dc01c81fe86c4ca6b7e97a69df979f4d48a4711df1ccaee6a3b6aa394f9ef91d719cb95851c4eb87dfa9ed6426e2577b95e0fb464 | ||
HEAD_REF master | ||
) | ||
|
||
configure_file( | ||
${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in | ||
${SOURCE_PATH}/builds/cmake/Config.cmake.in | ||
COPYONLY | ||
) | ||
|
||
foreach(_cmake_module Findczmq.cmake Findlibzmq.cmake) | ||
configure_file( | ||
${CMAKE_CURRENT_LIST_DIR}/${_cmake_module} | ||
${SOURCE_PATH}/${_cmake_module} | ||
COPYONLY | ||
) | ||
endforeach() | ||
|
||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ZYRE_BUILD_SHARED) | ||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ZYRE_BUILD_STATIC) | ||
|
||
vcpkg_configure_cmake( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
DISABLE_PARALLEL_CONFIGURE | ||
OPTIONS | ||
-DZYRE_BUILD_SHARED=${ZYRE_BUILD_SHARED} | ||
-DZYRE_BUILD_STATIC=${ZYRE_BUILD_STATIC} | ||
-DENABLE_DRAFTS=OFF | ||
) | ||
|
||
vcpkg_install_cmake() | ||
|
||
vcpkg_copy_pdbs() | ||
|
||
if(EXISTS ${CURRENT_PACKAGES_DIR}/CMake) | ||
vcpkg_fixup_cmake_targets(CONFIG_PATH CMake) | ||
elseif(EXISTS ${CURRENT_PACKAGES_DIR}/share/cmake/${PORT}) | ||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/${PORT}) | ||
endif() | ||
|
||
file(COPY | ||
${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake | ||
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} | ||
) | ||
|
||
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") | ||
set(EXECUTABLE_SUFFIX ".exe") | ||
else() | ||
set(EXECUTABLE_SUFFIX "") | ||
endif() | ||
|
||
file(COPY ${CURRENT_PACKAGES_DIR}/bin/zpinger${EXECUTABLE_SUFFIX} | ||
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) | ||
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) | ||
|
||
if(ZYRE_BUILD_SHARED) | ||
file(REMOVE | ||
${CURRENT_PACKAGES_DIR}/debug/bin/zpinger${EXECUTABLE_SUFFIX} | ||
${CURRENT_PACKAGES_DIR}/bin/zpinger${EXECUTABLE_SUFFIX}) | ||
else() | ||
file(REMOVE_RECURSE | ||
${CURRENT_PACKAGES_DIR}/bin | ||
${CURRENT_PACKAGES_DIR}/debug/bin) | ||
endif() | ||
|
||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) | ||
|
||
if(ZYRE_BUILD_STATIC) | ||
vcpkg_replace_string( | ||
${CURRENT_PACKAGES_DIR}/include/zyre_library.h | ||
"if defined ZYRE_STATIC" | ||
"if 1 //if defined ZYRE_STATIC" | ||
) | ||
endif() | ||
|
||
# Handle copyright | ||
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) | ||
|
||
# CMake integration test | ||
vcpkg_test_cmake(PACKAGE_NAME ${PORT}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
_find_package(${ARGS}) | ||
|
||
if(TARGET zyre AND NOT TARGET zyre-static) | ||
add_library(zyre-static INTERFACE IMPORTED) | ||
set_target_properties(zyre-static PROPERTIES INTERFACE_LINK_LIBRARIES zyre) | ||
elseif(TARGET zyre-static AND NOT TARGET zyre) | ||
add_library(zyre INTERFACE IMPORTED) | ||
set_target_properties(zyre PROPERTIES INTERFACE_LINK_LIBRARIES zyre-static) | ||
endif() |