IF(PCRE2_DIR)
  FIND_PATH(PCRE2_INCLUDE_DIR NAMES pcre2.h NO_DEFAULT_PATH PATHS ${PCRE2_DIR}/include ${PCRE2_DIR})
  FIND_LIBRARY(PCRE2_LIBRARY NAMES pcre2-8 NO_DEFAULT_PATH PATHS ${PCRE2_DIR}/lib ${PCRE2_DIR})
ELSE()
  FIND_PATH(PCRE2_INCLUDE_DIR NAMES pcre2.h PATHS /include /usr/include /usr/local/include /opt/local/include)
  FIND_LIBRARY(PCRE2_LIBRARY NAMES pcre2-8)
ENDIF()

IF (PCRE2_INCLUDE_DIR AND PCRE2_LIBRARY)
  SET(PCRE2_INCLUDE_DIRS "${PCRE2_INCLUDE_DIR}")
  SET(PCRE2_LIBRARIES ${PCRE2_LIBRARY})
  SET(PCRE2_FOUND true)
ENDIF()
#FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE2 DEFAULT_MSG HYPERSCAN_LIBRARIES HYPERSCAN_INCLUDE_DIRS)
