# Autogenerated file, run tools/build/setup_cmake.py to regenerate if(NOT DEFINED TCMalloc_HeapChecker_LIBRARIES) set(CHECK_COMPILES_BODY "new HeapLeakChecker(\"profiler\");") check_compiles("_environment" TCMalloc_HeapChecker TCMALLOC_HEAPCHECKER "#include " "" "" TCMalloc_HeapChecker_ok) if("${TCMalloc_HeapChecker_ok}" MATCHES "1") message(STATUS "Found TCMalloc_HeapChecker in environment") else() include(LibFindMacros) # Use pkg-config to get hints about paths libfind_pkg_check_modules("TCMalloc_HeapChecker_PKGCONF" "tcmalloc_heapchecker") # Include dir find_path("TCMalloc_HeapChecker_INCLUDE_DIR" NAMES gperftools/heap-checker.h PATHS ${TCMalloc_HeapChecker_PKGCONF_INCLUDE_DIRS} ) # Finally the library itself foreach(lib ) find_library("${lib}_LIBRARY" NAMES ${lib} PATHS ${TCMalloc_HeapChecker_PKGCONF_LIBRARY_DIRS} ) set("TCMalloc_HeapChecker_LIBRARY" ${TCMalloc_HeapChecker_LIBRARY} ${${lib}_LIBRARY}) endforeach(lib) # Set the include dir variables and the libraries and let libfind_process do the rest. # NOTE: Singular variables for this library, plural for libraries this this lib depends on. set(TCMalloc_HeapChecker_PROCESS_INCLUDES TCMalloc_HeapChecker_INCLUDE_DIR) set(TCMalloc_HeapChecker_PROCESS_LIBS TCMalloc_HeapChecker_LIBRARY) libfind_process(TCMalloc_HeapChecker) if ("${TCMalloc_HeapChecker_LIBRARY}" MATCHES ".*NOTFOUND.*" OR "${TCMalloc_HeapChecker_INCLUDE_DIR}" MATCHES ".*NOTFOUND.*") message("TCMalloc_HeapChecker not found") file(WRITE "${PROJECT_BINARY_DIR}/data/build_info/TCMalloc_HeapChecker" "ok=False") else() check_compiles("_found" "TCMalloc_HeapChecker" "TCMALLOC_HEAPCHECKER" "#include " "${TCMalloc_HeapChecker_INCLUDE_DIR}" "${TCMalloc_HeapChecker_LIBRARY}" TCMalloc_HeapChecker_ok_ok) if(${TCMalloc_HeapChecker_ok_ok} MATCHES "1") message(STATUS "Found TCMalloc_HeapChecker at ""${TCMalloc_HeapChecker_INCLUDE_DIR}" " " "${TCMalloc_HeapChecker_LIBRARY}") else() message("TCMalloc_HeapChecker not found") file(WRITE "${PROJECT_BINARY_DIR}/data/build_info/TCMalloc_HeapChecker" "ok=False") endif() endif() endif() else() message(STATUS "TCMalloc_HeapChecker already setup") endif(NOT DEFINED TCMalloc_HeapChecker_LIBRARIES)