2016-09-28 20:53:15 +02:00
|
|
|
# - Find JeMalloc library
|
|
|
|
# Find the native JeMalloc includes and library
|
|
|
|
#
|
2019-08-06 04:47:33 +02:00
|
|
|
# JeMalloc_INCLUDE_DIRS - where to find jemalloc.h, etc.
|
|
|
|
# JeMalloc_LIBRARIES - List of libraries when using jemalloc.
|
|
|
|
# JeMalloc_FOUND - True if jemalloc found.
|
2017-04-06 22:54:49 +02:00
|
|
|
|
2019-08-06 04:47:33 +02:00
|
|
|
find_path(JeMalloc_INCLUDE_DIRS
|
2017-04-06 22:54:49 +02:00
|
|
|
NAMES jemalloc/jemalloc.h
|
|
|
|
HINTS ${JEMALLOC_ROOT_DIR}/include)
|
2016-09-28 20:53:15 +02:00
|
|
|
|
2019-08-06 04:47:33 +02:00
|
|
|
find_library(JeMalloc_LIBRARIES
|
2017-04-06 22:54:49 +02:00
|
|
|
NAMES jemalloc
|
|
|
|
HINTS ${JEMALLOC_ROOT_DIR}/lib)
|
2016-09-28 20:53:15 +02:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2019-08-06 04:47:33 +02:00
|
|
|
find_package_handle_standard_args(JeMalloc DEFAULT_MSG JeMalloc_LIBRARIES JeMalloc_INCLUDE_DIRS)
|
2016-09-28 20:53:15 +02:00
|
|
|
|
2017-04-06 22:54:49 +02:00
|
|
|
mark_as_advanced(
|
2019-08-06 04:47:33 +02:00
|
|
|
JeMalloc_LIBRARIES
|
|
|
|
JeMalloc_INCLUDE_DIRS)
|
|
|
|
|
|
|
|
if(JeMalloc_FOUND AND NOT (TARGET JeMalloc::JeMalloc))
|
|
|
|
add_library (JeMalloc::JeMalloc UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(JeMalloc::JeMalloc
|
|
|
|
PROPERTIES
|
|
|
|
IMPORTED_LOCATION ${JeMalloc_LIBRARIES}
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES ${JeMalloc_INCLUDE_DIRS})
|
|
|
|
endif()
|