]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: enable find_package(perftools) to check non-default dir
authorKefu Chai <kchai@redhat.com>
Tue, 19 Sep 2017 03:55:16 +0000 (11:55 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 19 Sep 2017 05:46:50 +0000 (13:46 +0800)
so it checks $ENV{GPERF_ROOT} first.

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/Findgperftools.cmake

index c4db922f4a0c02ffae6384756e1b73b1c14c701c..17c9a71bce5179bf99de9509c7732a3b39b656b6 100644 (file)
@@ -8,12 +8,15 @@
 # GPERFTOOLS_TCMALLOC_MINIMAL_LIBRARY - link it to use tcmalloc_minimal
 # GPERFTOOLS_PROFILER_LIBRARY - link it to use Profiler
 
-find_path(GPERFTOOLS_INCLUDE_DIR gperftools/profiler.h)
-find_path(Tcmalloc_INCLUDE_DIR gperftools/tcmalloc.h)
+find_path(GPERFTOOLS_INCLUDE_DIR gperftools/profiler.h
+  HINTS $ENV{GPERF_ROOT}/include)
+find_path(Tcmalloc_INCLUDE_DIR gperftools/tcmalloc.h
+  HINTS $ENV{GPERF_ROOT}/include)
 
 foreach(component tcmalloc tcmalloc_minimal profiler)
   string(TOUPPER ${component} COMPONENT)
-  find_library(GPERFTOOLS_${COMPONENT}_LIBRARY ${component})
+  find_library(GPERFTOOLS_${COMPONENT}_LIBRARY ${component}
+    HINTS $ENV{GPERF_ROOT}/lib)
   list(APPEND GPERFTOOLS_LIBRARIES GPERFTOOLS_${COMPONENT}_LIBRARY)
 endforeach()