summaryrefslogtreecommitdiff
path: root/3rdparty/cmake/FindPCRE.cmake
diff options
context:
space:
mode:
authorTrojal <trojal@gmail.com>2013-01-10 20:09:39 -0800
committershennetsind <ind@henn.et>2013-01-12 05:56:35 -0200
commitc55855fcf627478f864c0f82a1a2f201fd407a38 (patch)
treeb7f6d11b2058248d026f2d9944e8f4b6ac288d50 /3rdparty/cmake/FindPCRE.cmake
parent51bfeb38eb139e97e0e1c096c85c15fba234f35b (diff)
parent38e583df21eccd9e4f31d38acaae32579c6f0d27 (diff)
downloadhercules-c55855fcf627478f864c0f82a1a2f201fd407a38.tar.gz
hercules-c55855fcf627478f864c0f82a1a2f201fd407a38.tar.bz2
hercules-c55855fcf627478f864c0f82a1a2f201fd407a38.tar.xz
hercules-c55855fcf627478f864c0f82a1a2f201fd407a38.zip
Test1, testing for the commit widget, need to edit something.
Test2, testing for the commit widget, need to edit something. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to '3rdparty/cmake/FindPCRE.cmake')
-rw-r--r--3rdparty/cmake/FindPCRE.cmake36
1 files changed, 36 insertions, 0 deletions
diff --git a/3rdparty/cmake/FindPCRE.cmake b/3rdparty/cmake/FindPCRE.cmake
new file mode 100644
index 000000000..2215451d1
--- /dev/null
+++ b/3rdparty/cmake/FindPCRE.cmake
@@ -0,0 +1,36 @@
+# - Find pcre
+# Find the native PCRE includes and library
+#
+# PCRE_INCLUDE_DIRS - where to find pcre.h
+# PCRE_LIBRARIES - List of libraries when using pcre.
+# PCRE_FOUND - True if pcre found.
+
+
+find_path( PCRE_INCLUDE_DIR pcre.h
+ PATHS
+ "/usr/include/pcre" )
+set( PCRE_NAMES pcre )
+find_library( PCRE_LIBRARY NAMES ${PCRE_NAMES} )
+mark_as_advanced( PCRE_LIBRARY PCRE_INCLUDE_DIR )
+
+if( PCRE_INCLUDE_DIR AND EXISTS "${PCRE_INCLUDE_DIR}/pcre.h" )
+ file( STRINGS "${PCRE_INCLUDE_DIR}/pcre.h" PCRE_H REGEX "^#define[ \t]+PCRE_M[A-Z]+[ \t]+[0-9]+.*$" )
+ string( REGEX REPLACE "^.*PCRE_MAJOR[ \t]+([0-9]+).*$" "\\1" PCRE_MAJOR "${PCRE_H}" )
+ string( REGEX REPLACE "^.*PCRE_MINOR[ \t]+([0-9]+).*$" "\\1" PCRE_MINOR "${PCRE_H}" )
+
+ set( PCRE_VERSION_STRING "${PCRE_MAJOR}.${PCRE_MINOR}" )
+ set( PCRE_VERSION_MAJOR "${PCRE_MAJOR}" )
+ set( PCRE_VERSION_MINOR "${PCRE_MINOR}" )
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if
+# all listed variables are TRUE
+include( FindPackageHandleStandardArgs )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS( PCRE
+ REQUIRED_VARS PCRE_LIBRARY PCRE_INCLUDE_DIR
+ VERSION_VAR PCRE_VERSION_STRING )
+
+if( PCRE_FOUND )
+ set( PCRE_LIBRARIES ${PCRE_LIBRARY} )
+ set( PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR} )
+endif()