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
|
2018-03-21 11:15:27 +08:00
|
|
|
REF 15b3dccf47179a88311c84d6ef250565abd05182
|
|
|
|
SHA512 568d315f48c194f7db3df59ecf70a6625e916a4c258a3f5ad1d7b9e5899afd6a7d825f4fb8811cb49dcd752142952a9bd6e4c31af6572373462a4821d6a1a2bd
|
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)
|
|
|
|
|
|
|
|
set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} \"-I${SOURCE_PATH}/builds/msvc\"")
|
|
|
|
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} \"-I${SOURCE_PATH}/builds/msvc\"")
|
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DZMQ_BUILD_TESTS=OFF
|
|
|
|
-DPOLLER=select
|
|
|
|
-DBUILD_STATIC=${BUILD_STATIC}
|
|
|
|
-DBUILD_SHARED=${BUILD_SHARED}
|
|
|
|
-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
|
|
|
|
2018-01-04 11:52:14 +08:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/zeromq/ZeroMQConfig.cmake _contents)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
string(REPLACE "get_target_property(ZeroMQ_STATIC_LIBRARY libzmq-static LOCATION)" "add_library(libzmq-static INTERFACE IMPORTED)\nset_target_properties(libzmq-static PROPERTIES INTERFACE_LINK_LIBRARIES libzmq)" _contents "${_contents}")
|
|
|
|
set(_contents "${_contents}\nset(ZeroMQ_STATIC_LIBRARY \${ZeroMQ_LIBRARY})\n")
|
|
|
|
else()
|
|
|
|
string(REPLACE "get_target_property(ZeroMQ_LIBRARY libzmq LOCATION)" "add_library(libzmq INTERFACE IMPORTED)\nset_target_properties(libzmq PROPERTIES INTERFACE_LINK_LIBRARIES libzmq-static)" _contents "${_contents}")
|
|
|
|
set(_contents "${_contents}\nset(ZeroMQ_LIBRARY \${ZeroMQ_STATIC_LIBRARY})\n")
|
|
|
|
endif()
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/zeromq/ZeroMQConfig.cmake "${_contents}")
|
|
|
|
|
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)
|