File: FindXXHash.cmake

package info (click to toggle)
libyang 5.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 11,212 kB
  • sloc: ansic: 131,170; xml: 671; sh: 448; tcl: 325; makefile: 19
file content (42 lines) | stat: -rw-r--r-- 1,065 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Try to find XXHash
# Once done this will define
#
# Read-Only variables:
#  XXHASH_FOUND - system has XXHash
#  XXHASH_INCLUDE_DIR - the XXHash include directory
#  XXHASH_LIBRARY - Link these to use XXHash

find_path(XXHASH_INCLUDE_DIR
    NAMES
        xxhash.h
    PATHS
        /usr/include
        /usr/local/include
        /opt/local/include
        /sw/include
        ${CMAKE_INCLUDE_PATH}
        ${CMAKE_INSTALL_PREFIX}/include
)

find_library(XXHASH_LIBRARY
    NAMES
        xxhash
        libxxhash
    PATHS
        PATHS
        /usr/lib
        /usr/lib64
        /usr/local/lib
        /usr/local/lib64
        /opt/local/lib
        /sw/lib
        ${CMAKE_LIBRARY_PATH}
        ${CMAKE_INSTALL_PREFIX}/lib
)

# for 32-bit system compatibility
set(CMAKE_REQUIRED_LIBRARIES ${XXHASH_LIBRARY})
check_symbol_exists(XXH3_64bits_withSeed ${XXHASH_INCLUDE_DIR}/xxhash.h HAVE_XXH3_64BITS_WITHSEED)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(XXHash FOUND_VAR XXHASH_FOUND REQUIRED_VARS XXHASH_INCLUDE_DIR XXHASH_LIBRARY)