]> git.proxmox.com Git - ceph.git/blame - ceph/cmake/modules/FindJeMalloc.cmake
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / cmake / modules / FindJeMalloc.cmake
CommitLineData
7c673cae
FG
1# Find the native JeMalloc includes and library
2# This module defines
3# JEMALLOC_INCLUDE_DIRS, where to find jemalloc.h, Set when
4# JEMALLOC_INCLUDE_DIR is found.
5# JEMALLOC_LIBRARIES, libraries to link against to use JeMalloc.
11fdf7f2 6# JeMalloc_FOUND, If false, do not try to use JeMalloc.
7c673cae
FG
7#
8
9find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h)
10
11find_library(JEMALLOC_LIBRARIES jemalloc)
12
13include(FindPackageHandleStandardArgs)
11fdf7f2
TL
14find_package_handle_standard_args(JeMalloc
15 FOUND_VAR JeMalloc_FOUND
16 REQUIRED_VARS JEMALLOC_LIBRARIES JEMALLOC_INCLUDE_DIR)
7c673cae
FG
17
18mark_as_advanced(
19 JEMALLOC_INCLUDE_DIR
20 JEMALLOC_LIBRARIES)
21
11fdf7f2
TL
22if(JeMalloc_FOUND AND NOT (TARGET JeMalloc::JeMalloc))
23 add_library(JeMalloc::JeMalloc UNKNOWN IMPORTED)
24 set_target_properties(JeMalloc::JeMalloc PROPERTIES
25 INTERFACE_INCLUDE_DIRECTORIES "${JEMALLOC_INCLUDE_DIR}"
26 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
27 IMPORTED_LOCATION "${JEMALLOC_LIBRARIES}")
28endif()