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-08-07 02:53:15 +08:00
|
|
|
REF release-2.1.11-stable
|
|
|
|
SHA512 a34ca4ad4d55a989a4f485f929d0ed2438d070d0e12a19d90c2b12783a562419c64db6a2603b093d958a75246d14ffefc8730c69c90b1b2f48339bde947f0e02
|
2018-02-10 22:49:27 +08:00
|
|
|
PATCHES
|
2019-06-26 07:11:45 +08:00
|
|
|
fix-file_path.patch
|
2019-09-26 01:55:43 +08:00
|
|
|
fix-crt_linkage.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}
|
2019-09-26 01:55:43 +08:00
|
|
|
-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}
|
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()
|
|
|
|
|
2019-08-07 02:53:15 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
2019-06-26 07:11:45 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/libevent)
|
2019-08-07 02:53:15 +08:00
|
|
|
else ()
|
2019-06-26 07:11:45 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share)
|
|
|
|
endif()
|
|
|
|
|
2019-08-07 02:53:15 +08:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/libevent/)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/event_rpcgen.py ${CURRENT_PACKAGES_DIR}/tools/libevent/event_rpcgen.py)
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
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)
|