2017-04-03 20:54:11 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-07-14 06:52:03 +08:00
|
|
|
|
2017-07-21 10:18:00 +08:00
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
|
2019-05-03 13:57:43 +08:00
|
|
|
message(FATAL_ERROR "${PORT} does not currently support UWP")
|
2017-07-21 10:18:00 +08:00
|
|
|
endif()
|
|
|
|
|
2017-07-14 06:52:03 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO libevent/libevent
|
2019-06-26 07:11:45 +08:00
|
|
|
REF release-2.1.10-stable
|
|
|
|
SHA512 8c336df258f7a12164da739b0ea68bebcc8b2ea4f4a839300aa1c5edfb673ac5d6517f882ba04ab35d406489ddd682a319e39fa6784ac0cab73227d42e503a55
|
2018-02-10 22:49:27 +08:00
|
|
|
PATCHES
|
2019-06-26 07:11:45 +08:00
|
|
|
fix-file_path.patch
|
|
|
|
fix-arm_build.patch
|
2018-02-10 22:49:27 +08:00
|
|
|
)
|
|
|
|
|
2019-06-26 07:11:45 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
set(LIBEVENT_LIB_TYPE SHARED)
|
|
|
|
else()
|
|
|
|
set(LIBEVENT_LIB_TYPE STATIC)
|
|
|
|
endif()
|
|
|
|
|
2017-04-03 20:54:11 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2018-02-10 22:49:27 +08:00
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
2018-05-19 01:57:31 +08:00
|
|
|
-DEVENT_INSTALL_CMAKE_DIR:PATH=share/libevent
|
2019-06-26 07:11:45 +08:00
|
|
|
-DEVENT__LIBRARY_TYPE=${LIBEVENT_LIB_TYPE}
|
2018-02-10 22:49:27 +08:00
|
|
|
-DEVENT__DISABLE_BENCHMARK=ON
|
|
|
|
-DEVENT__DISABLE_TESTS=ON
|
|
|
|
-DEVENT__DISABLE_REGRESS=ON
|
|
|
|
-DEVENT__DISABLE_SAMPLES=ON
|
2017-04-03 20:54:11 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2017-04-06 07:56:53 +08:00
|
|
|
|
2019-06-26 07:11:45 +08:00
|
|
|
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "windows" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/libevent)
|
|
|
|
elseif (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share)
|
|
|
|
elseif (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share)
|
|
|
|
endif()
|
|
|
|
|
2017-07-14 06:52:03 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2017-04-06 07:56:53 +08:00
|
|
|
|
2017-07-14 06:52:03 +08:00
|
|
|
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libevent)
|
2017-04-03 20:54:11 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libevent/LICENSE ${CURRENT_PACKAGES_DIR}/share/libevent/copyright)
|