aboutsummaryrefslogtreecommitdiff
path: root/modules/FindPCRE.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'modules/FindPCRE.cmake')
-rw-r--r--modules/FindPCRE.cmake34
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/FindPCRE.cmake b/modules/FindPCRE.cmake
new file mode 100644
index 00000000..350cced8
--- /dev/null
+++ b/modules/FindPCRE.cmake
@@ -0,0 +1,34 @@
+
+FIND_PATH(PCRE_INCLUDE_DIR pcre.h
+/usr/include/
+/usr/local/include/
+)
+
+FIND_LIBRARY(PCRE_PCRE_LIBRARY NAMES pcre
+PATHS
+/usr/lib
+/usr/local/lib
+)
+
+FIND_LIBRARY(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix
+PATHS
+/usr/lib
+/usr/local/lib
+)
+
+SET(PCRE_LIBRARY ${PCRE_PCRE_LIBRARY} ${PCRE_PCREPOSIX_LIBRARY})
+
+IF(PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
+ SET(PCRE_FOUND TRUE)
+ENDIF(PCRE_INCLUDE_DIR AND PCRE_LIBRARY)
+
+
+IF(PCRE_FOUND)
+ IF(NOT PCRE_FIND_QUIETLY)
+ MESSAGE(STATUS "Found PCRE: ${PCRE_LIBRARY}")
+ ENDIF(NOT PCRE_FIND_QUIETLY)
+ELSE(PCRE_FOUND)
+ IF(PCRE_FIND_REQUIRED)
+ MESSAGE(SEND_ERROR "Could not find PCRE")
+ ENDIF(PCRE_FIND_REQUIRED)
+ENDIF(PCRE_FOUND)