aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/cmake/FindGooglePerfTools.cmake
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/cmake/FindGooglePerfTools.cmake
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/cmake/FindGooglePerfTools.cmake')
-rw-r--r--linden/indra/cmake/FindGooglePerfTools.cmake66
1 files changed, 66 insertions, 0 deletions
diff --git a/linden/indra/cmake/FindGooglePerfTools.cmake b/linden/indra/cmake/FindGooglePerfTools.cmake
new file mode 100644
index 0000000..bb125d5
--- /dev/null
+++ b/linden/indra/cmake/FindGooglePerfTools.cmake
@@ -0,0 +1,66 @@
1# -*- cmake -*-
2
3# - Find Google perftools
4# Find the Google perftools includes and libraries
5# This module defines
6# GOOGLE_PERFTOOLS_INCLUDE_DIR, where to find heap-profiler.h, etc.
7# GOOGLE_PERFTOOLS_FOUND, If false, do not try to use Google perftools.
8# also defined for general use are
9# TCMALLOC_LIBRARIES, where to find the tcmalloc library.
10# STACKTRACE_LIBRARIES, where to find the stacktrace library.
11# PROFILER_LIBRARIES, where to find the profiler library.
12
13FIND_PATH(GOOGLE_PERFTOOLS_INCLUDE_DIR google/heap-profiler.h
14/usr/local/include
15/usr/include
16)
17
18SET(TCMALLOC_NAMES ${TCMALLOC_NAMES} tcmalloc)
19FIND_LIBRARY(TCMALLOC_LIBRARY
20 NAMES ${TCMALLOC_NAMES}
21 PATHS /usr/lib /usr/local/lib
22 )
23
24IF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
25 SET(TCMALLOC_LIBRARIES ${TCMALLOC_LIBRARY})
26 SET(GOOGLE_PERFTOOLS_FOUND "YES")
27ELSE (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
28 SET(GOOGLE_PERFTOOLS_FOUND "NO")
29ENDIF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
30
31SET(STACKTRACE_NAMES ${STACKTRACE_NAMES} stacktrace)
32FIND_LIBRARY(STACKTRACE_LIBRARY
33 NAMES ${STACKTRACE_LIBRARY}
34 PATHS /usr/lib /usr/local/lib
35 )
36
37IF (STACKTRACE_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
38 SET(STACKTRACE_LIBRARIES ${STACKTRACE_LIBRARY})
39ENDIF (STACKTRACE_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
40
41SET(PROFILER_NAMES ${PROFILER_NAMES} profiler)
42FIND_LIBRARY(PROFILER_LIBRARY
43 NAMES ${PROFILER_LIBRARY}
44 PATHS /usr/lib /usr/local/lib
45 )
46
47IF (PROFILER_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
48 SET(PROFILER_LIBRARIES ${PROFILER_LIBRARY})
49ENDIF (PROFILER_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
50
51IF (GOOGLE_PERFTOOLS_FOUND)
52 IF (NOT GOOGLE_PERFTOOLS_FIND_QUIETLY)
53 MESSAGE(STATUS "Found Google perftools: ${GOOGLE_PERFTOOLS_LIBRARIES}")
54 ENDIF (NOT GOOGLE_PERFTOOLS_FIND_QUIETLY)
55ELSE (GOOGLE_PERFTOOLS_FOUND)
56 IF (GOOGLE_PERFTOOLS_FIND_REQUIRED)
57 MESSAGE(FATAL_ERROR "Could not find Google perftools library")
58 ENDIF (GOOGLE_PERFTOOLS_FIND_REQUIRED)
59ENDIF (GOOGLE_PERFTOOLS_FOUND)
60
61MARK_AS_ADVANCED(
62 TCMALLOC_LIBRARY
63 STACKTRACE_LIBRARY
64 PROFILER_LIBRARY
65 GOOGLE_PERFTOOLS_INCLUDE_DIR
66 )