forked from couchbase/forestdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindJemalloc.cmake
35 lines (32 loc) · 1.09 KB
/
FindJemalloc.cmake
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
# Locate jemalloc libraries on a host OS.
IF (UNIX)
FIND_PATH(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h
PATH_SUFFIXES include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/opt/local
/opt/csw
/opt)
FIND_LIBRARY(JEMALLOC_LIBRARIES
NAMES jemalloc
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/opt/local
/opt/csw
/opt)
ELSEIF (WIN32)
ENDIF()
IF (JEMALLOC_LIBRARIES)
MESSAGE(STATUS "Found jemalloc libraries in ${JEMALLOC_INCLUDE_DIR} :
${JEMALLOC_LIBRARIES}")
ADD_DEFINITIONS(-D_JEMALLOC=1)
set(MALLOC_LIBRARIES ${JEMALLOC_LIBRARIES})
include_directories(AFTER ${JEMALLOC_INCLUDE_DIR})
MARK_AS_ADVANCED(MALLOC_INCLUDE_DIR JEMALLOC_LIBRARIES)
ELSE (JEMALLOC_LIBRARIES)
MESSAGE(FATAL_ERROR "Can't find jemalloc libraries")
ENDIF (JEMALLOC_LIBRARIES)