File: FindTcmalloc.cmake

package info (click to toggle)
scram 0.16.2-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,016 kB
  • sloc: xml: 120,766; cpp: 23,966; python: 1,256; ansic: 100; makefile: 9
file content (33 lines) | stat: -rw-r--r-- 877 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# - Find Tcmalloc
# Find the native Tcmalloc includes and library
#
#  Tcmalloc_LIBRARIES   - List of libraries when using Tcmalloc.
#  Tcmalloc_FOUND       - True if Tcmalloc found.

if(USE_TCMALLOC)
  set(Tcmalloc_NAMES tcmalloc)
else()
  set(Tcmalloc_NAMES tcmalloc_minimal tcmalloc)
endif()

find_library(Tcmalloc_LIBRARY NAMES ${Tcmalloc_NAMES})

if(Tcmalloc_LIBRARY)
  set(Tcmalloc_FOUND TRUE)
  set(Tcmalloc_LIBRARIES ${Tcmalloc_LIBRARY})
else()
  set(Tcmalloc_FOUND FALSE)
  set(Tcmalloc_LIBRARIES)
endif()

if(Tcmalloc_FOUND)
  message(STATUS "Found Tcmalloc: ${Tcmalloc_LIBRARY}")
else()
  message(STATUS "Not Found Tcmalloc: ${Tcmalloc_LIBRARY}")
  if(Tcmalloc_FIND_REQUIRED)
    message(STATUS "Looked for Tcmalloc libraries named ${Tcmalloc_NAMES}.")
    message(FATAL_ERROR "Could NOT find Tcmalloc library")
  endif()
endif()

mark_as_advanced(Tcmalloc_LIBRARY)