murmurhash (#10164)

This commit is contained in:
kreuzerkrieg 2020-03-09 17:33:45 +02:00 committed by GitHub
parent 769f5bc4a8
commit d0b1f2a9e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,61 @@
cmake_minimum_required(VERSION 3.14)
set(VERSION "1.0.0")
project(murmurhash LANGUAGES CXX VERSION ${VERSION})
set(CMAKE_CXX_STANDARD 17)
add_library(murmurhash
src/MurmurHash2.cpp
src/MurmurHash3.cpp
)
target_include_directories(murmurhash SYSTEM PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/src)
set(MURMUR_HEADERS
src/MurmurHash2.h
src/MurmurHash3.h
)
set_target_properties(murmurhash PROPERTIES
PUBLIC_HEADER "${MURMUR_HEADERS}"
)
#Configuration
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
set(config_install_dir "lib/cmake/${PROJECT_NAME}")
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
set(namespace "${PROJECT_NAME}::")
include(CMakePackageConfigHelpers)
# Configure '<PROJECT-NAME>ConfigVersion.cmake'
# Use:
# * PROJECT_VERSION
write_basic_package_version_file(
"${version_config}" COMPATIBILITY SameMajorVersion
)
# Configure '<PROJECT-NAME>Config.cmake'
# Use variables:
# * TARGETS_EXPORT_NAME
# * PROJECT_NAME
configure_package_config_file(
"${CMAKE_SOURCE_DIR}/Config.cmake.in"
"${project_config}"
INSTALL_DESTINATION "${config_install_dir}"
)
#Installation
install(TARGETS murmurhash
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION "lib"
ARCHIVE DESTINATION "lib"
INCLUDES DESTINATION "include")
install(FILES "${project_config}" "${version_config}"
DESTINATION "${config_install_dir}"
)
install(EXPORT "${TARGETS_EXPORT_NAME}"
NAMESPACE "${namespace}"
DESTINATION "${config_install_dir}"
)

4
ports/murmurhash/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: murmurhash
Version: 2016-01-09
Homepage: https://github.com/aappleby/smhasher
Description: MurmurHash a family of hash functions.

View File

@ -0,0 +1,4 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
check_required_components("@PROJECT_NAME@")

View File

@ -0,0 +1,25 @@
vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP")
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO aappleby/smhasher
REF 61a0530f28277f2e850bfc39600ce61d02b518de
SHA512 36877b53386153c20421ccd32d544c28ee72f6f13ea37c14ab1a1db378f6463db28339b2149671c12611384497bf595b798e99c34ea0ebceb6f9ef2f8908a2b6
HEAD_REF master
)
configure_file(${CURRENT_PORT_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY)
configure_file(${CURRENT_PORT_DIR}/Config.cmake.in ${SOURCE_PATH}/Config.cmake.in COPYONLY)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake)
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "MurmurHash3 was written by Austin Appleby, and is placed in the public domain. The author hereby disclaims copyright to this source code.")

View File

@ -1151,6 +1151,9 @@ msmpi:x64-osx=fail
msmpi:x64-uwp=fail
muparser:arm-uwp=fail
muparser:x64-uwp=fail
murmurhash:arm-uwp=fail
murmurhash:x64-uwp=fail
murmurhash:arm64-windows=fail
nana:arm-uwp=fail
nana:x64-linux=fail
nana:x64-osx=fail