diff options
Diffstat (limited to 'linden/indra/cmake/FindAPR.cmake')
-rw-r--r-- | linden/indra/cmake/FindAPR.cmake | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/linden/indra/cmake/FindAPR.cmake b/linden/indra/cmake/FindAPR.cmake new file mode 100644 index 0000000..906b6c9 --- /dev/null +++ b/linden/indra/cmake/FindAPR.cmake | |||
@@ -0,0 +1,94 @@ | |||
1 | # -*- cmake -*- | ||
2 | |||
3 | # - Find Apache Portable Runtime | ||
4 | # Find the APR includes and libraries | ||
5 | # This module defines | ||
6 | # APR_INCLUDE_DIR and APRUTIL_INCLUDE_DIR, where to find apr.h, etc. | ||
7 | # APR_LIBRARIES and APRUTIL_LIBRARIES, the libraries needed to use APR. | ||
8 | # APR_FOUND and APRUTIL_FOUND, If false, do not try to use APR. | ||
9 | # also defined, but not for general use are | ||
10 | # APR_LIBRARY and APRUTIL_LIBRARY, where to find the APR library. | ||
11 | |||
12 | # APR first. | ||
13 | |||
14 | FIND_PATH(APR_INCLUDE_DIR apr.h | ||
15 | /usr/local/include/apr-1 | ||
16 | /usr/local/include/apr-1.0 | ||
17 | /usr/include/apr-1 | ||
18 | /usr/include/apr-1.0 | ||
19 | ) | ||
20 | |||
21 | SET(APR_NAMES ${APR_NAMES} apr-1) | ||
22 | FIND_LIBRARY(APR_LIBRARY | ||
23 | NAMES ${APR_NAMES} | ||
24 | PATHS /usr/lib /usr/local/lib | ||
25 | ) | ||
26 | |||
27 | IF (APR_LIBRARY AND APR_INCLUDE_DIR) | ||
28 | SET(APR_LIBRARIES ${APR_LIBRARY}) | ||
29 | SET(APR_FOUND "YES") | ||
30 | ELSE (APR_LIBRARY AND APR_INCLUDE_DIR) | ||
31 | SET(APR_FOUND "NO") | ||
32 | ENDIF (APR_LIBRARY AND APR_INCLUDE_DIR) | ||
33 | |||
34 | |||
35 | IF (APR_FOUND) | ||
36 | IF (NOT APR_FIND_QUIETLY) | ||
37 | MESSAGE(STATUS "Found APR: ${APR_LIBRARIES}") | ||
38 | ENDIF (NOT APR_FIND_QUIETLY) | ||
39 | ELSE (APR_FOUND) | ||
40 | IF (APR_FIND_REQUIRED) | ||
41 | MESSAGE(FATAL_ERROR "Could not find APR library") | ||
42 | ENDIF (APR_FIND_REQUIRED) | ||
43 | ENDIF (APR_FOUND) | ||
44 | |||
45 | # Deprecated declarations. | ||
46 | SET (NATIVE_APR_INCLUDE_PATH ${APR_INCLUDE_DIR} ) | ||
47 | GET_FILENAME_COMPONENT (NATIVE_APR_LIB_PATH ${APR_LIBRARY} PATH) | ||
48 | |||
49 | MARK_AS_ADVANCED( | ||
50 | APR_LIBRARY | ||
51 | APR_INCLUDE_DIR | ||
52 | ) | ||
53 | |||
54 | # Next, APRUTIL. | ||
55 | |||
56 | FIND_PATH(APRUTIL_INCLUDE_DIR apu.h | ||
57 | /usr/local/include/apr-1 | ||
58 | /usr/local/include/apr-1.0 | ||
59 | /usr/include/apr-1 | ||
60 | /usr/include/apr-1.0 | ||
61 | ) | ||
62 | |||
63 | SET(APRUTIL_NAMES ${APRUTIL_NAMES} aprutil-1) | ||
64 | FIND_LIBRARY(APRUTIL_LIBRARY | ||
65 | NAMES ${APRUTIL_NAMES} | ||
66 | PATHS /usr/lib /usr/local/lib | ||
67 | ) | ||
68 | |||
69 | IF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) | ||
70 | SET(APRUTIL_LIBRARIES ${APRUTIL_LIBRARY}) | ||
71 | SET(APRUTIL_FOUND "YES") | ||
72 | ELSE (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) | ||
73 | SET(APRUTIL_FOUND "NO") | ||
74 | ENDIF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) | ||
75 | |||
76 | |||
77 | IF (APRUTIL_FOUND) | ||
78 | IF (NOT APRUTIL_FIND_QUIETLY) | ||
79 | MESSAGE(STATUS "Found APRUTIL: ${APRUTIL_LIBRARIES}") | ||
80 | ENDIF (NOT APRUTIL_FIND_QUIETLY) | ||
81 | ELSE (APRUTIL_FOUND) | ||
82 | IF (APRUTIL_FIND_REQUIRED) | ||
83 | MESSAGE(FATAL_ERROR "Could not find APRUTIL library") | ||
84 | ENDIF (APRUTIL_FIND_REQUIRED) | ||
85 | ENDIF (APRUTIL_FOUND) | ||
86 | |||
87 | # Deprecated declarations. | ||
88 | SET (NATIVE_APRUTIL_INCLUDE_PATH ${APRUTIL_INCLUDE_DIR} ) | ||
89 | GET_FILENAME_COMPONENT (NATIVE_APRUTIL_LIB_PATH ${APRUTIL_LIBRARY} PATH) | ||
90 | |||
91 | MARK_AS_ADVANCED( | ||
92 | APRUTIL_LIBRARY | ||
93 | APRUTIL_INCLUDE_DIR | ||
94 | ) | ||