aboutsummaryrefslogtreecommitdiff
path: root/Tools/cmake/FindPCRE2.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/cmake/FindPCRE2.cmake')
-rw-r--r--Tools/cmake/FindPCRE2.cmake21
1 files changed, 21 insertions, 0 deletions
diff --git a/Tools/cmake/FindPCRE2.cmake b/Tools/cmake/FindPCRE2.cmake
new file mode 100644
index 000000000..08c216347
--- /dev/null
+++ b/Tools/cmake/FindPCRE2.cmake
@@ -0,0 +1,21 @@
+# - Find PCRE2
+# Perl Compatible Regular Expressions
+# https://www.pcre.org/
+
+# The following variables are set:
+# PCRE2_FOUND - System has the PCRE library
+# PCRE2_LIBRARIES - The PCRE library file
+# PCRE2_INCLUDE_DIRS - The folder with the PCRE headers
+
+find_library(PCRE2_LIBRARY NAMES pcre2 pcre2-8)
+find_path(PCRE2_INCLUDE_DIR pcre2.h)
+
+set (PCRE2_LIBRARIES ${PCRE2_LIBRARY})
+set (PCRE2_INCLUDE_DIRS ${PCRE2_INCLUDE_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PCRE2 DEFAULT_MSG PCRE2_LIBRARIES PCRE2_INCLUDE_DIRS)
+
+mark_as_advanced (
+ PCRE2_LIBRARY
+ PCRE2_INCLUDE_DIR)