diff --git a/CMakeLists.txt b/CMakeLists.txt index c5358938..f2bcec71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,7 @@ if(ZLTOOLKIT_FOUND) list(APPEND LINK_LIB_LIST ${ZLTOOLKIT_LIBRARIES}) endif() -#查找ZLToolKit是否安装 +#查找JEMALLOC是否安装 find_package(JEMALLOC QUIET) if(JEMALLOC_FOUND) message(STATUS "找到JEMALLOC库:\"${JEMALLOC_INCLUDE_DIR}\"") diff --git a/cmake/FindJEMALLOC.cmake b/cmake/FindJEMALLOC.cmake new file mode 100644 index 00000000..35184347 --- /dev/null +++ b/cmake/FindJEMALLOC.cmake @@ -0,0 +1,16 @@ + + +find_path(JEMALLOC_INCLUDE_DIR + NAMES jemalloc/jemalloc.h + ) + +find_library(JEMALLOC_LIBRARY + NAMES jemalloc + ) + +set(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR}) +set(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY}) + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(JEMALLOC DEFAULT_MSG JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)