Added FindJemalloc.cmake

This commit is contained in:
Markus Makela
2015-04-26 11:41:02 +03:00
parent c500d23d04
commit 9eeec2e9d3
2 changed files with 12 additions and 1 deletions

11
cmake/FindJemalloc.cmake Normal file
View File

@ -0,0 +1,11 @@
# this CMake file defines the following variables
# JEMALLOC_FOUND - Jemalloc was found
# JEMALLOC_LIBRARIES - Jemalloc library
find_library(JEMALLOC_LIBRARIES NAMES jemalloc libjemalloc.so.4 libjemalloc.so.4.2.2)
if(JEMALLOC_LIBRARIES)
set(JEMALLOC_FOUND TRUE CACHE INTERNAL "")
message(STATUS "Found libjemalloc: ${JEMALLOC_LIBRARIES}")
else()
set(JEMALLOC_FOUND FALSE CACHE INTERNAL "")
message(STATUS "Could not find libjemalloc, using system default malloc instead.")
endif()