summaryrefslogtreecommitdiff
path: root/indra/cmake/FindURIPARSER.cmake
diff options
context:
space:
mode:
authormaksymsproductengine <maksymsproductengine@lindenlab.com>2014-09-22 20:01:55 +0300
committermaksymsproductengine <maksymsproductengine@lindenlab.com>2014-09-22 20:01:55 +0300
commit61e05f912557e3086cd80a10075aeaa6586519be (patch)
tree273d774f45d2522041c752015dc4247890dfc7e3 /indra/cmake/FindURIPARSER.cmake
parent9c4a8951fffb2a649647178f396f01cf68f114fc (diff)
MAINT-4170 Eliminate homoglyphs in URL hostnames: used 3p-uriparser;
Diffstat (limited to 'indra/cmake/FindURIPARSER.cmake')
-rw-r--r--indra/cmake/FindURIPARSER.cmake46
1 files changed, 46 insertions, 0 deletions
diff --git a/indra/cmake/FindURIPARSER.cmake b/indra/cmake/FindURIPARSER.cmake
new file mode 100644
index 0000000000..32457bcd60
--- /dev/null
+++ b/indra/cmake/FindURIPARSER.cmake
@@ -0,0 +1,46 @@
+# -*- cmake -*-
+
+# - Find uriparser
+# Find the URIPARSER includes and library
+# This module defines
+# URIPARSER_INCLUDE_DIRS, where to find uriparser.h, etc.
+# URIPARSER_LIBRARIES, the libraries needed to use uriparser.
+# URIPARSER_FOUND, If false, do not try to use uriparser.
+#
+# This FindURIPARSER is about 43 times as fast the one provided with cmake (2.8.x),
+# because it doesn't look up the version of uriparser, resulting in a dramatic
+# speed up for configure (from 4 minutes 22 seconds to 6 seconds).
+#
+# Note: Since this file is only used for standalone, the windows
+# specific parts were left out.
+
+FIND_PATH(URIPARSER_INCLUDE_DIR uriparser/uri.h
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+
+FIND_LIBRARY(URIPARSER_LIBRARY z)
+
+if (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
+ SET(URIPARSER_INCLUDE_DIRS ${URIPARSER_INCLUDE_DIR})
+ SET(URIPARSER_LIBRARIES ${URIPARSER_LIBRARY})
+ SET(URIPARSER_FOUND "YES")
+else (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
+ SET(URIPARSER_FOUND "NO")
+endif (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
+
+if (URIPARSER_FOUND)
+ if (NOT URIPARSER_FIND_QUIETLY)
+ message(STATUS "Found URIPARSER: ${URIPARSER_LIBRARIES}")
+ SET(URIPARSER_FIND_QUIETLY TRUE)
+ endif (NOT URIPARSER_FIND_QUIETLY)
+else (URIPARSER_FOUND)
+ if (URIPARSER_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find URIPARSER library")
+ endif (URIPARSER_FIND_REQUIRED)
+endif (URIPARSER_FOUND)
+
+mark_as_advanced(
+ URIPARSER_LIBRARY
+ URIPARSER_INCLUDE_DIR
+ )
+