-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cityhash does not provide any CMake packages. Add a `Findcityhash.cmake` script to help find cityhash. Signed-off-by: Ruoyu Zhong <[email protected]>
- Loading branch information
1 parent
85dae8e
commit bb85459
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 () |