FindAPR.cmake 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing,
  12. # software distributed under the License is distributed on an
  13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. # KIND, either express or implied. See the License for the
  15. # specific language governing permissions and limitations
  16. # under the License.
  17. # - Find Apache Portable Runtime
  18. # Find the APR includes and libraries
  19. # This module defines
  20. # APR_INCLUDE_DIR and APRUTIL_INCLUDE_DIR, where to find apr.h, etc.
  21. # APR_LIBRARIES and APRUTIL_LIBRARIES, the libraries needed to use APR.
  22. # APR_FOUND and APRUTIL_FOUND, If false, do not try to use APR.
  23. # also defined, but not for general use are
  24. # APR_LIBRARY and APRUTIL_LIBRARY, where to find the APR library.
  25. # APR first.
  26. FIND_PATH(APR_INCLUDE_DIR apr.h
  27. /usr/local/include/apr-1
  28. /usr/local/include/apr-1.0
  29. /usr/include/apr-1
  30. /usr/include/apr-1.0
  31. )
  32. SET(APR_NAMES ${APR_NAMES} apr-1)
  33. FIND_LIBRARY(APR_LIBRARY
  34. NAMES ${APR_NAMES}
  35. PATHS /usr/lib /usr/local/lib
  36. )
  37. IF (APR_LIBRARY AND APR_INCLUDE_DIR)
  38. SET(APR_LIBRARIES ${APR_LIBRARY})
  39. SET(APR_FOUND "YES")
  40. ELSE (APR_LIBRARY AND APR_INCLUDE_DIR)
  41. SET(APR_FOUND "NO")
  42. ENDIF (APR_LIBRARY AND APR_INCLUDE_DIR)
  43. IF (APR_FOUND)
  44. IF (NOT APR_FIND_QUIETLY)
  45. MESSAGE(STATUS "Found APR: ${APR_LIBRARIES}")
  46. ENDIF (NOT APR_FIND_QUIETLY)
  47. ELSE (APR_FOUND)
  48. IF (APR_FIND_REQUIRED)
  49. MESSAGE(FATAL_ERROR "Could not find APR library")
  50. ENDIF (APR_FIND_REQUIRED)
  51. ENDIF (APR_FOUND)
  52. # Deprecated declarations.
  53. SET (NATIVE_APR_INCLUDE_PATH ${APR_INCLUDE_DIR} )
  54. GET_FILENAME_COMPONENT (NATIVE_APR_LIB_PATH ${APR_LIBRARY} PATH)
  55. MARK_AS_ADVANCED(
  56. APR_LIBRARY
  57. APR_INCLUDE_DIR
  58. )
  59. # Next, APRUTIL.
  60. FIND_PATH(APRUTIL_INCLUDE_DIR apu.h
  61. /usr/local/include/apr-1
  62. /usr/local/include/apr-1.0
  63. /usr/include/apr-1
  64. /usr/include/apr-1.0
  65. )
  66. SET(APRUTIL_NAMES ${APRUTIL_NAMES} aprutil-1)
  67. FIND_LIBRARY(APRUTIL_LIBRARY
  68. NAMES ${APRUTIL_NAMES}
  69. PATHS /usr/lib /usr/local/lib
  70. )
  71. IF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
  72. SET(APRUTIL_LIBRARIES ${APRUTIL_LIBRARY})
  73. SET(APRUTIL_FOUND "YES")
  74. ELSE (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
  75. SET(APRUTIL_FOUND "NO")
  76. ENDIF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR)
  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. # Deprecated declarations.
  87. SET (NATIVE_APRUTIL_INCLUDE_PATH ${APRUTIL_INCLUDE_DIR} )
  88. GET_FILENAME_COMPONENT (NATIVE_APRUTIL_LIB_PATH ${APRUTIL_LIBRARY} PATH)
  89. MARK_AS_ADVANCED(
  90. APRUTIL_LIBRARY
  91. APRUTIL_INCLUDE_DIR
  92. )