[murmur3] New port (#34335)

This commit is contained in:
Samuel Marks 2023-10-12 23:55:10 -04:00 committed by GitHub
parent 8007fc4dff
commit 65cad452fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,47 @@
cmake_minimum_required(VERSION 3.19)
project(murmur3 LANGUAGES C)
set(PROJECT_VERSION "${VERSION}")
set(Header_Files "${PROJECT_NAME}.h")
set(Source_Files "${PROJECT_NAME}.c")
add_library("${PROJECT_NAME}" "${Header_Files}" "${Source_Files}")
include(GNUInstallDirs)
target_include_directories(
"${PROJECT_NAME}"
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_compile_features("${PROJECT_NAME}" PRIVATE c_std_90)
set_target_properties("${PROJECT_NAME}" PROPERTIES C_VISIBILITY_PRESET hidden
PUBLIC_HEADER "${Header_Files}")
install(
TARGETS "${PROJECT_NAME}"
EXPORT "unofficial-${PROJECT_NAME}Config"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
include(CMakePackageConfigHelpers)
set(VERSION_FILE_PATH "${CMAKE_CURRENT_BINARY_DIR}/unofficial-${PROJECT_NAME}ConfigVersion.cmake")
write_basic_package_version_file(
"${VERSION_FILE_PATH}"
VERSION "${PROJECT_VERSION}"
COMPATIBILITY SameMajorVersion
)
install(FILES "${VERSION_FILE_PATH}" DESTINATION "share/unofficial-${PROJECT_NAME}")
install(FILES ${Header_Files} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(
EXPORT "unofficial-${PROJECT_NAME}Config"
FILE "unofficial-${PROJECT_NAME}Config.cmake"
NAMESPACE "unofficial::${PROJECT_NAME}::"
DESTINATION "share/unofficial-${PROJECT_NAME}")
export(PACKAGE "${PROJECT_NAME}")

View File

@ -0,0 +1,28 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO PeterScott/murmur3
REF dae94be0c0f54a399d23ea6cbe54bca5a4e93ce4
SHA512 1bc01eefc04f06704800a7448231db9f82fc809079bd3f43ef24d7dd3d8deaec2143f252a8e556dafe366401f898b676922b0c93ac181aaf38ae69ad638adbba
HEAD_REF master
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt"
DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"-DVERSION=${VERSION}"
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "CC0-1.0")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/include")

3
ports/murmur3/usage Normal file
View File

@ -0,0 +1,3 @@
murmur3 provides CMake targets:
find_package(unofficial-murmur3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::murmur3::murmur3)

17
ports/murmur3/vcpkg.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "murmur3",
"version-date": "2015-05-02",
"description": "Murmur3 hash in C",
"homepage": "https://github.com/PeterScott/murmur3",
"license": "CC0-1.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -5668,6 +5668,10 @@
"baseline": "2.3.4",
"port-version": 0
},
"murmur3": {
"baseline": "2015-05-02",
"port-version": 0
},
"murmurhash": {
"baseline": "2016-01-09",
"port-version": 7

9
versions/m-/murmur3.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "5f4ab89578aaab8f3e4edf66398db2a693753abb",
"version-date": "2015-05-02",
"port-version": 0
}
]
}