2016-10-24 00:32:12 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2017-09-09 08:32:19 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO zeromq/libzmq
|
2019-07-10 03:49:38 +08:00
|
|
|
REF b5db4b4421c8b2766321e70e5e9ca07c197fac47
|
|
|
|
SHA512 e1166b9eec3c0613c2b085bf995e6d711554ba77e180f7b86aa2d04157f2ab7dca8131b855568f8fc931ac256628f6018e6bc67bc9fbecfd498776b4151d6e63
|
2017-09-09 08:32:19 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
2016-10-25 18:27:21 +08:00
|
|
|
|
2017-09-09 08:32:19 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
|
|
|
|
|
2019-07-10 03:49:38 +08:00
|
|
|
vcpkg_check_features(sodium WITH_LIBSODIUM)
|
2019-03-08 08:43:12 +08:00
|
|
|
|
2017-09-09 08:32:19 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DZMQ_BUILD_TESTS=OFF
|
|
|
|
-DPOLLER=select
|
|
|
|
-DBUILD_STATIC=${BUILD_STATIC}
|
|
|
|
-DBUILD_SHARED=${BUILD_SHARED}
|
2019-03-08 08:43:12 +08:00
|
|
|
-DWITH_LIBSODIUM=${WITH_LIBSODIUM}
|
2017-09-09 08:32:19 +08:00
|
|
|
-DWITH_PERF_TOOL=OFF
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
"-DCMAKE_PDB_OUTPUT_DIRECTORY=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg"
|
|
|
|
)
|
2016-10-25 05:42:16 +08:00
|
|
|
|
2017-09-09 08:32:19 +08:00
|
|
|
vcpkg_install_cmake()
|
2016-10-25 05:42:16 +08:00
|
|
|
|
2017-09-09 08:32:19 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2016-10-24 00:32:12 +08:00
|
|
|
|
2018-03-22 03:27:29 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/CMake)
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH CMake)
|
|
|
|
endif()
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/share/cmake/ZeroMQ)
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/ZeroMQ)
|
|
|
|
endif()
|
2016-10-24 00:32:12 +08:00
|
|
|
|
2019-07-10 03:49:38 +08:00
|
|
|
file(COPY
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
|
|
|
|
)
|
|
|
|
|
2019-03-08 08:43:12 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/zmq.h
|
|
|
|
"defined ZMQ_STATIC"
|
|
|
|
"1 //defined ZMQ_STATIC"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2019-07-10 03:49:38 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2018-04-06 06:28:05 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
2018-01-04 11:52:14 +08:00
|
|
|
endif()
|
|
|
|
|
2016-10-24 00:32:12 +08:00
|
|
|
# Handle copyright
|
2017-09-09 08:32:19 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/zmq/COPYING.LESSER.txt ${CURRENT_PACKAGES_DIR}/share/zeromq/copyright)
|
2016-10-24 00:32:12 +08:00
|
|
|
|
2017-09-09 08:32:19 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/zmq)
|
2019-07-10 03:49:38 +08:00
|
|
|
|
|
|
|
# CMake integration test
|
|
|
|
vcpkg_test_cmake(PACKAGE_NAME ZeroMQ)
|