From da8ce07a21abbc58089b6bb4a1044be18dacbd2f Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 19 Sep 2017 11:55:16 +0800 Subject: [PATCH] cmake: enable find_package(perftools) to check non-default dir so it checks $ENV{GPERF_ROOT} first. Signed-off-by: Kefu Chai --- cmake/modules/Findgperftools.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/modules/Findgperftools.cmake b/cmake/modules/Findgperftools.cmake index c4db922f4a0c0..17c9a71bce517 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() -- 2.39.5