2018-10-23 00:04:13 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO mfontanini/libtins
|
2023-10-18 01:38:47 +08:00
|
|
|
REF "v${VERSION}"
|
|
|
|
SHA512 d8887949cb545dbaf4247c8405feb5cc1032f370bb418dd5344043dc97555b1b826a8d33cfc7dd0a7a9a9af6f3a46bd6fcbed89f98d5eb23fdd10294f823fcd6
|
2018-10-23 00:04:13 +08:00
|
|
|
HEAD_REF master
|
2021-12-03 11:51:12 +08:00
|
|
|
PATCHES
|
|
|
|
fix-source-writes.patch
|
|
|
|
find-pcap_static.patch
|
2023-10-14 02:24:19 +08:00
|
|
|
fix_include.patch
|
2018-10-23 00:04:13 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LIBTINS_BUILD_SHARED)
|
|
|
|
|
2021-11-30 08:44:14 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2018-10-23 00:04:13 +08:00
|
|
|
OPTIONS
|
|
|
|
-DLIBTINS_BUILD_SHARED=${LIBTINS_BUILD_SHARED}
|
2020-09-25 04:43:48 +08:00
|
|
|
-DLIBTINS_ENABLE_CXX11=1
|
2021-12-03 11:51:12 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=1
|
2018-10-23 00:04:13 +08:00
|
|
|
)
|
|
|
|
|
2021-11-30 08:44:14 +08:00
|
|
|
vcpkg_cmake_install()
|
2021-12-03 11:51:12 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2018-10-23 00:04:13 +08:00
|
|
|
|
2021-12-03 11:51:12 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2021-11-30 08:44:14 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH CMake)
|
2021-12-03 11:51:12 +08:00
|
|
|
else()
|
2021-11-30 08:44:14 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libtins)
|
2019-06-25 02:38:10 +08:00
|
|
|
endif()
|
2018-10-23 00:04:13 +08:00
|
|
|
|
2021-11-30 08:44:14 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/libtins/libtinsConfig.cmake" "set(LIBTINS_INCLUDE_DIRS \"${SOURCE_PATH}/include\")" [[
|
|
|
|
get_filename_component(LIBTINS_CMAKE_DIR "${LIBTINS_CMAKE_DIR}" PATH)
|
|
|
|
get_filename_component(LIBTINS_CMAKE_DIR "${LIBTINS_CMAKE_DIR}" PATH)
|
|
|
|
set(LIBTINS_INCLUDE_DIRS "${LIBTINS_CMAKE_DIR}/include")
|
|
|
|
]])
|
|
|
|
|
2022-02-19 06:42:04 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/libtins/libtinsConfig.cmake" "\${LIBTINS_CMAKE_DIR}/libtinsTargets.cmake" "\${CMAKE_CURRENT_LIST_DIR}/libtinsTargets.cmake")
|
|
|
|
|
2022-02-01 03:58:13 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/tins/macros.h" "!defined(TINS_STATIC)" "1")
|
|
|
|
else()
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/tins/macros.h" "!defined(TINS_STATIC)" "0")
|
|
|
|
endif()
|
|
|
|
|
2021-11-30 08:44:14 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2018-10-23 00:04:13 +08:00
|
|
|
|
|
|
|
# Handle copyright
|
2021-11-30 08:44:14 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libtins" RENAME copyright)
|