1# Module for locating libnuma
2#
3# Read-only variables:
4#   NUMA_FOUND
5#     Indicates that the library has been found.
6#
7#   NUMA_INCLUDE_DIR
8#     Points to the libnuma include directory.
9#
10#   NUMA_LIBRARY_DIR
11#     Points to the directory that contains the libraries.
12#     The content of this variable can be passed to link_directories.
13#
14#   NUMA_LIBRARY
15#     Points to the libnuma that can be passed to target_link_libararies.
16#
17# Copyright (c) 2013-2020 MulticoreWare, Inc
18
19include(FindPackageHandleStandardArgs)
20
21find_path(NUMA_ROOT_DIR
22  NAMES include/numa.h
23  PATHS ENV NUMA_ROOT
24  DOC "NUMA root directory")
25
26find_path(NUMA_INCLUDE_DIR
27  NAMES numa.h
28  HINTS ${NUMA_ROOT_DIR}
29  PATH_SUFFIXES include
30  DOC "NUMA include directory")
31
32find_library(NUMA_LIBRARY
33  NAMES numa
34  HINTS ${NUMA_ROOT_DIR}
35  DOC "NUMA library")
36
37if (NUMA_LIBRARY)
38    get_filename_component(NUMA_LIBRARY_DIR ${NUMA_LIBRARY} PATH)
39endif()
40
41mark_as_advanced(NUMA_INCLUDE_DIR NUMA_LIBRARY_DIR NUMA_LIBRARY)
42
43find_package_handle_standard_args(NUMA REQUIRED_VARS NUMA_ROOT_DIR NUMA_INCLUDE_DIR NUMA_LIBRARY)
44