diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/cmake/FindGooglePerfTools.cmake | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-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.cmake | 66 |
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 | |||
13 | FIND_PATH(GOOGLE_PERFTOOLS_INCLUDE_DIR google/heap-profiler.h | ||
14 | /usr/local/include | ||
15 | /usr/include | ||
16 | ) | ||
17 | |||
18 | SET(TCMALLOC_NAMES ${TCMALLOC_NAMES} tcmalloc) | ||
19 | FIND_LIBRARY(TCMALLOC_LIBRARY | ||
20 | NAMES ${TCMALLOC_NAMES} | ||
21 | PATHS /usr/lib /usr/local/lib | ||
22 | ) | ||
23 | |||
24 | IF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) | ||
25 | SET(TCMALLOC_LIBRARIES ${TCMALLOC_LIBRARY}) | ||
26 | SET(GOOGLE_PERFTOOLS_FOUND "YES") | ||
27 | ELSE (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) | ||
28 | SET(GOOGLE_PERFTOOLS_FOUND "NO") | ||
29 | ENDIF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) | ||
30 | |||
31 | SET(STACKTRACE_NAMES ${STACKTRACE_NAMES} stacktrace) | ||
32 | FIND_LIBRARY(STACKTRACE_LIBRARY | ||
33 | NAMES ${STACKTRACE_LIBRARY} | ||
34 | PATHS /usr/lib /usr/local/lib | ||
35 | ) | ||
36 | |||
37 | IF (STACKTRACE_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) | ||
38 | SET(STACKTRACE_LIBRARIES ${STACKTRACE_LIBRARY}) | ||
39 | ENDIF (STACKTRACE_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) | ||
40 | |||
41 | SET(PROFILER_NAMES ${PROFILER_NAMES} profiler) | ||
42 | FIND_LIBRARY(PROFILER_LIBRARY | ||
43 | NAMES ${PROFILER_LIBRARY} | ||
44 | PATHS /usr/lib /usr/local/lib | ||
45 | ) | ||
46 | |||
47 | IF (PROFILER_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) | ||
48 | SET(PROFILER_LIBRARIES ${PROFILER_LIBRARY}) | ||
49 | ENDIF (PROFILER_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR) | ||
50 | |||
51 | IF (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) | ||
55 | ELSE (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) | ||
59 | ENDIF (GOOGLE_PERFTOOLS_FOUND) | ||
60 | |||
61 | MARK_AS_ADVANCED( | ||
62 | TCMALLOC_LIBRARY | ||
63 | STACKTRACE_LIBRARY | ||
64 | PROFILER_LIBRARY | ||
65 | GOOGLE_PERFTOOLS_INCLUDE_DIR | ||
66 | ) | ||