ceph/cmake/modules/Findtcmalloc.cmake
Kefu Chai 3f6fd585f8 cmake: cleanup Findtcmalloc.cmake
use find_package_handle_standard_args() and remove unused bits.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 15:39:01 +08:00

29 lines
762 B
CMake

# - Find Tcmalloc
# Find the native Tcmalloc includes and library
#
# Tcmalloc_INCLUDE_DIR - where to find Tcmalloc.h, etc.
# Tcmalloc_LIBRARIES - List of libraries when using Tcmalloc.
# Tcmalloc_FOUND - True if Tcmalloc found.
find_path(Tcmalloc_INCLUDE_DIR google/tcmalloc.h PATHS
/usr/include
/opt/local/include
/usr/local/include)
find_library(Tcmalloc_LIBRARY
NAMES tcmalloc_minimal tcmalloc
PATHS /lib /usr/lib /usr/local/lib /opt/local/lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Tcmalloc
FOUND_VAR Tcmalloc_FOUND
REQUIRED_VARS Tcmalloc_INCLUDE_DIR Tcmalloc_LIBRARY)
if(Tcmalloc_FOUND)
set(Tcmalloc_LIBRARIES ${Tcmalloc_LIBRARY})
endif()
mark_as_advanced(
Tcmalloc_LIBRARY
Tcmalloc_INCLUDE_DIR)