FindJeMalloc.cmake 858 字节
Newer Older
M
minqiyang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# - Find JeMalloc library
# Find the native JeMalloc includes and library
#
# JEMALLOC_INCLUDE_DIR - where to find jemalloc.h, etc.
# JEMALLOC_LIBRARIES - List of libraries when using jemalloc.
# JEMALLOC_FOUND - True if jemalloc found.

find_path(JEMALLOC_INCLUDE_DIR
  NAMES jemalloc/jemalloc.h
  HINTS ${JEMALLOC_ROOT_DIR}/include)

find_library(JEMALLOC_LIBRARIES
  NAMES jemalloc
  HINTS ${JEMALLOC_ROOT_DIR}/lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(jemalloc DEFAULT_MSG JEMALLOC_LIBRARIES JEMALLOC_INCLUDE_DIR)

mark_as_advanced(
  JEMALLOC_LIBRARIES
  JEMALLOC_INCLUDE_DIR)
M
minqiyang 已提交
22 23 24 25 26 27 28

if (JEMALLOC_FOUND)
  add_library(jemalloc::jemalloc UNKNOWN IMPORTED)
  set_target_properties(jemalloc::jemalloc PROPERTIES
    IMPORTED_LOCATION ${JEMALLOC_LIBRARIES}
    INTERFACE_INCLUDE_DIRECTORIES "${JEMALLOC_INCLUDE_DIR}")
endif()