cloudflare/ClickHouse
Publicmirrored fromhttps://github.com/cloudflare/ClickHouse
cmake/Modules/FindGperftools.cmake
61lines · modecode
| 1 | # https://github.com/vast-io/vast/blob/master/cmake/FindGperftools.cmake |
| 2 | |
| 3 | # Tries to find Gperftools. |
| 4 | # |
| 5 | # Usage of this module as follows: |
| 6 | # |
| 7 | # find_package(Gperftools) |
| 8 | # |
| 9 | # Variables used by this module, they can change the default behaviour and need |
| 10 | # to be set before calling find_package: |
| 11 | # |
| 12 | # Gperftools_ROOT_DIR Set this variable to the root installation of |
| 13 | # Gperftools if the module has problems finding |
| 14 | # the proper installation path. |
| 15 | # |
| 16 | # Variables defined by this module: |
| 17 | # |
| 18 | # GPERFTOOLS_FOUND System has Gperftools libs/headers |
| 19 | # GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler) |
| 20 | # GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers |
| 21 | |
| 22 | find_library(GPERFTOOLS_TCMALLOC |
| 23 | NAMES tcmalloc |
| 24 | HINTS ${Gperftools_ROOT_DIR}/lib) |
| 25 | |
| 26 | find_library(GPERFTOOLS_TCMALLOC_MINIMAL |
| 27 | NAMES tcmalloc_minimal |
| 28 | HINTS ${Gperftools_ROOT_DIR}/lib) |
| 29 | |
| 30 | find_library(GPERFTOOLS_TCMALLOC_MINIMAL_DEBUG |
| 31 | NAMES tcmalloc_minimal_debug |
| 32 | HINTS ${Gperftools_ROOT_DIR}/lib) |
| 33 | |
| 34 | find_library(GPERFTOOLS_PROFILER |
| 35 | NAMES profiler |
| 36 | HINTS ${Gperftools_ROOT_DIR}/lib) |
| 37 | |
| 38 | find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER |
| 39 | NAMES tcmalloc_and_profiler |
| 40 | HINTS ${Gperftools_ROOT_DIR}/lib) |
| 41 | |
| 42 | find_path(GPERFTOOLS_INCLUDE_DIR |
| 43 | NAMES gperftools/heap-profiler.h |
| 44 | HINTS ${Gperftools_ROOT_DIR}/include) |
| 45 | |
| 46 | set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER}) |
| 47 | |
| 48 | include(FindPackageHandleStandardArgs) |
| 49 | find_package_handle_standard_args( |
| 50 | Gperftools |
| 51 | DEFAULT_MSG |
| 52 | GPERFTOOLS_LIBRARIES |
| 53 | GPERFTOOLS_INCLUDE_DIR) |
| 54 | |
| 55 | mark_as_advanced( |
| 56 | Gperftools_ROOT_DIR |
| 57 | GPERFTOOLS_TCMALLOC |
| 58 | GPERFTOOLS_PROFILER |
| 59 | GPERFTOOLS_TCMALLOC_AND_PROFILER |
| 60 | GPERFTOOLS_LIBRARIES |
| 61 | GPERFTOOLS_INCLUDE_DIR) |