FindPCREPOSIX.cmake 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. # - Find pcreposix
  2. # Find the native PCRE and PCREPOSIX include and libraries
  3. #
  4. # PCRE_INCLUDE_DIR - where to find pcreposix.h, etc.
  5. # PCREPOSIX_LIBRARIES - List of libraries when using libpcreposix.
  6. # PCRE_LIBRARIES - List of libraries when using libpcre.
  7. # PCREPOSIX_FOUND - True if libpcreposix found.
  8. # PCRE_FOUND - True if libpcre found.
  9. IF (PCRE_INCLUDE_DIR)
  10. # Already in cache, be silent
  11. SET(PCRE_FIND_QUIETLY TRUE)
  12. ENDIF (PCRE_INCLUDE_DIR)
  13. FIND_PATH(PCRE_INCLUDE_DIR pcreposix.h)
  14. FIND_LIBRARY(PCREPOSIX_LIBRARY NAMES pcreposix libpcreposix)
  15. FIND_LIBRARY(PCRE_LIBRARY NAMES pcre libpcre)
  16. # handle the QUIETLY and REQUIRED arguments and set PCREPOSIX_FOUND to TRUE if
  17. # all listed variables are TRUE
  18. INCLUDE(FindPackageHandleStandardArgs)
  19. FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCREPOSIX DEFAULT_MSG PCREPOSIX_LIBRARY PCRE_INCLUDE_DIR)
  20. FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY)
  21. IF(PCREPOSIX_FOUND)
  22. SET(PCREPOSIX_LIBRARIES ${PCREPOSIX_LIBRARY})
  23. SET(HAVE_LIBPCREPOSIX 1)
  24. SET(HAVE_PCREPOSIX_H 1)
  25. ENDIF(PCREPOSIX_FOUND)
  26. IF(PCRE_FOUND)
  27. SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
  28. SET(HAVE_LIBPCRE 1)
  29. ENDIF(PCRE_FOUND)