Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / cmake / modules / Findgperftools.cmake
1 # Try to find gperftools
2 # Once done, this will define
3 #
4 # GPERFTOOLS_FOUND - system has Profiler
5 # GPERFTOOLS_INCLUDE_DIR - the Profiler include directories
6 # Tcmalloc_INCLUDE_DIR - where to find Tcmalloc.h
7 # GPERFTOOLS_TCMALLOC_LIBRARY - link it to use tcmalloc
8 # GPERFTOOLS_TCMALLOC_MINIMAL_LIBRARY - link it to use tcmalloc_minimal
9 # GPERFTOOLS_PROFILER_LIBRARY - link it to use Profiler
10
11 find_path(GPERFTOOLS_INCLUDE_DIR gperftools/profiler.h)
12 find_path(Tcmalloc_INCLUDE_DIR gperftools/tcmalloc.h)
13
14 foreach(component tcmalloc tcmalloc_minimal profiler)
15   string(TOUPPER ${component} COMPONENT)
16   find_library(GPERFTOOLS_${COMPONENT}_LIBRARY ${component})
17   list(APPEND GPERFTOOLS_LIBRARIES GPERFTOOLS_${COMPONENT}_LIBRARY)
18 endforeach()
19
20 include(FindPackageHandleStandardArgs)
21 find_package_handle_standard_args(gperftools DEFAULT_MSG GPERFTOOLS_LIBRARIES GPERFTOOLS_INCLUDE_DIR)
22
23 mark_as_advanced(GPERFTOOLS_LIBRARIES GPERFTOOLS_INCLUDE_DIR)