From 599a9ef3ca705f33fd240b8a02c00946497ad115 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 31 Oct 2017 16:58:02 +0800 Subject: [PATCH] cmake: should use the value of GPERFTOOLS_LIBRARIES as REQUIRED_VARS otherwise it's always true, even if the libaries are not found. also the cmake output will be wrong without this change: without this change, it is: -- Found gperftools: GPERFTOOLS_TCMALLOC_LIBRARY;GPERFTOOLS_TCMALLOC_MINIMAL_LIBRARY;GPERFTOOLS_PROFILER_LIBRARY (found version "2.5.93") with this change, it would be: -- Found gperftools: /tmp/gperf/lib/libtcmalloc.so (found version "2.5.93") Signed-off-by: Kefu Chai --- cmake/modules/Findgperftools.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/Findgperftools.cmake b/cmake/modules/Findgperftools.cmake index 3d9b7e98c24..e9aa9bfb003 100644 --- a/cmake/modules/Findgperftools.cmake +++ b/cmake/modules/Findgperftools.cmake @@ -40,7 +40,7 @@ endforeach() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(gperftools - REQUIRED_VARS GPERFTOOLS_LIBRARIES GPERFTOOLS_INCLUDE_DIR + REQUIRED_VARS ${GPERFTOOLS_LIBRARIES} GPERFTOOLS_INCLUDE_DIR VERSION_VAR TCMALLOC_VERSION_STRING) -mark_as_advanced(GPERFTOOLS_LIBRARIES GPERFTOOLS_INCLUDE_DIR) +mark_as_advanced(${GPERFTOOLS_LIBRARIES} GPERFTOOLS_INCLUDE_DIR) -- 2.47.3