FindAPR.cmake 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # -*- cmake -*-
  2. # - Find Apache Portable Runtime
  3. # Find the APR includes and libraries
  4. # This module defines
  5. # APR_INCLUDE_DIR, where to find apr.h, etc.
  6. # APR_LIBRARIES, the libraries needed to use APR.
  7. # APR_FOUND, If false, do not try to use APR.
  8. # also defined, but not for general use are
  9. # APR_LIBRARY, where to find the APR library.
  10. find_path(APR_INCLUDE_DIR apr.h
  11. /usr/local/include/apr-1
  12. /usr/local/include/apr-1.0
  13. /usr/include/apr-1
  14. /usr/include/apr-1.0
  15. )
  16. set(APR_NAMES ${APR_NAMES} apr-1)
  17. find_library(APR_LIBRARY NAMES ${APR_NAMES}
  18. PATHS /usr/lib64 /usr/local/lib64 /usr/lib /usr/local/lib)
  19. if (APR_LIBRARY AND APR_INCLUDE_DIR)
  20. set(APR_LIBRARIES ${APR_LIBRARY})
  21. set(APR_FOUND "YES")
  22. else (APR_LIBRARY AND APR_INCLUDE_DIR)
  23. set(APR_FOUND "NO")
  24. endif (APR_LIBRARY AND APR_INCLUDE_DIR)
  25. if (APR_FOUND)
  26. if (NOT APR_FIND_QUIETLY)
  27. message(STATUS "Found APR: ${APR_LIBRARIES}")
  28. endif (NOT APR_FIND_QUIETLY)
  29. else (APR_FOUND)
  30. if (APR_FIND_REQUIRED)
  31. message(FATAL_ERROR "Could not find APR library")
  32. endif (APR_FIND_REQUIRED)
  33. endif (APR_FOUND)