From: Kefu Chai Date: Tue, 19 Sep 2017 03:55:16 +0000 (+0800) Subject: cmake: enable find_package(perftools) to check non-default dir X-Git-Tag: v13.0.1~859^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=da8ce07a21abbc58089b6bb4a1044be18dacbd2f;p=ceph.git cmake: enable find_package(perftools) to check non-default dir so it checks $ENV{GPERF_ROOT} first. Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/Findgperftools.cmake b/cmake/modules/Findgperftools.cmake index c4db922f4a0c..17c9a71bce51 100644 --- a/cmake/modules/Findgperftools.cmake +++ b/cmake/modules/Findgperftools.cmake @@ -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()