if(PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
    set(PCRE_FIND_QUIETLY TRUE)
endif()

find_path(PCRE_INCLUDE_DIR pcre.h)
find_library(PCRE_LIBRARY NAMES pcre)
set(PCRE_LIBRARIES ${PCRE_LIBRARY})

if(PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
    set(PCRE_FOUND TRUE)
endif()

if(PCRE_FOUND)
    if(NOT PCRE_FIND_QUIETLY)
        message(STATUS "Found Perl Compatible Regular Expressions library: ${PCRE_INCLUDE_DIR}")
    endif()
else()
    if(PCRE_FIND_REQUIRED)
        message(FATAL_ERROR "Could not find Perl Compatible Regular Expressions library")
    endif()
endif()