Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix system cityhash setup #301

Merged
merged 1 commit into from
May 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions cmake/Findcityhash.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
find_path(cityhash_INCLUDE_DIR
NAMES city.h
DOC "cityhash include directory")
mark_as_advanced(cityhash_INCLUDE_DIR)
find_library(cityhash_LIBRARY
NAMES cityhash libcityhash
DOC "cityhash library")
mark_as_advanced(cityhash_LIBRARY)

# Unlike lz4, cityhash's version information does not seem to be available.

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(cityhash
REQUIRED_VARS cityhash_LIBRARY cityhash_INCLUDE_DIR)

if (cityhash_FOUND)
set(cityhash_INCLUDE_DIRS "${cityhash_INCLUDE_DIR}")
set(cityhash_LIBRARIES "${cityhash_LIBRARY}")

if (NOT TARGET cityhash::cityhash)
add_library(cityhash::cityhash UNKNOWN IMPORTED)
set_target_properties(cityhash::cityhash PROPERTIES
IMPORTED_LOCATION "${cityhash_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${cityhash_INCLUDE_DIR}")
endif ()
endif ()