PageRenderTime 13ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/cmake/FindAPR.cmake

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 94 lines | 64 code | 17 blank | 13 comment | 0 complexity | f96fc41e4d7ba00c94d4b971701759bb MD5 | raw file
 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
14FIND_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
21SET(APR_NAMES ${APR_NAMES} apr-1)
22FIND_LIBRARY(APR_LIBRARY
23  NAMES ${APR_NAMES}
24  PATHS /usr/lib /usr/local/lib
25  )
26
27IF (APR_LIBRARY AND APR_INCLUDE_DIR)
28    SET(APR_LIBRARIES ${APR_LIBRARY})
29    SET(APR_FOUND "YES")
30ELSE (APR_LIBRARY AND APR_INCLUDE_DIR)
31  SET(APR_FOUND "NO")
32ENDIF (APR_LIBRARY AND APR_INCLUDE_DIR)
33
34
35IF (APR_FOUND)
36   IF (NOT APR_FIND_QUIETLY)
37      MESSAGE(STATUS "Found APR: ${APR_LIBRARIES}")
38   ENDIF (NOT APR_FIND_QUIETLY)
39ELSE (APR_FOUND)
40   IF (APR_FIND_REQUIRED)
41      MESSAGE(FATAL_ERROR "Could not find APR library")
42   ENDIF (APR_FIND_REQUIRED)
43ENDIF (APR_FOUND)
44
45# Deprecated declarations.
46SET (NATIVE_APR_INCLUDE_PATH ${APR_INCLUDE_DIR} )
47GET_FILENAME_COMPONENT (NATIVE_APR_LIB_PATH ${APR_LIBRARY} PATH)
48
49MARK_AS_ADVANCED(
50  APR_LIBRARY
51  APR_INCLUDE_DIR
52  )
53
54# Next, APRUTIL.
55
56FIND_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
63SET(APRUTIL_NAMES ${APRUTIL_NAMES} aprutil-1)
64FIND_LIBRARY(APRUTIL_LIBRARY
65  NAMES ${APRUTIL_NAMES}
66  PATHS /usr/lib /usr/local/lib
67  )
68
69IF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
70    SET(APRUTIL_LIBRARIES ${APRUTIL_LIBRARY})
71    SET(APRUTIL_FOUND "YES")
72ELSE (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
73  SET(APRUTIL_FOUND "NO")
74ENDIF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
75
76
77IF (APRUTIL_FOUND)
78   IF (NOT APRUTIL_FIND_QUIETLY)
79      MESSAGE(STATUS "Found APRUTIL: ${APRUTIL_LIBRARIES}")
80   ENDIF (NOT APRUTIL_FIND_QUIETLY)
81ELSE (APRUTIL_FOUND)
82   IF (APRUTIL_FIND_REQUIRED)
83      MESSAGE(FATAL_ERROR "Could not find APRUTIL library")
84   ENDIF (APRUTIL_FIND_REQUIRED)
85ENDIF (APRUTIL_FOUND)
86
87# Deprecated declarations.
88SET (NATIVE_APRUTIL_INCLUDE_PATH ${APRUTIL_INCLUDE_DIR} )
89GET_FILENAME_COMPONENT (NATIVE_APRUTIL_LIB_PATH ${APRUTIL_LIBRARY} PATH)
90
91MARK_AS_ADVANCED(
92  APRUTIL_LIBRARY
93  APRUTIL_INCLUDE_DIR
94  )