Use the system copy of zlib by default, like we do with autotools.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4313 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 854f712..04c7697 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,6 +85,14 @@
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> --output-format=coff <SOURCE>")
endif()
+# Check for zlib
+find_package(ZLIB)
+option(USE_INCLUDED_ZLIB "Force use of the bundled zlib")
+if(NOT ZLIB_FOUND)
+ message(STATUS "System zlib not found. Using included zlib")
+ set(USE_INCLUDED_ZLIB 1)
+endif()
+
# Check for GNUTLS library
find_package(GnuTLS)
if(GNUTLS_FOUND)