- Modified CMakeLists to support zlib

diff --git a/programs/ssl/CMakeLists.txt b/programs/ssl/CMakeLists.txt
index 4dcf01c..1986b08 100644
--- a/programs/ssl/CMakeLists.txt
+++ b/programs/ssl/CMakeLists.txt
@@ -6,6 +6,10 @@
     set(libs ${libs} pkcs11-helper)
 endif(USE_PKCS11_HELPER_LIBRARY)
 
+if(ENABLE_ZLIB_SUPPORT)
+    set(libs ${libs} ${ZLIB_LIBRARIES})
+endif(ENABLE_ZLIB_SUPPORT)
+
 add_executable(ssl_client1 ssl_client1.c)
 target_link_libraries(ssl_client1 ${libs})
 
diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt
index f00fc9d..c05b903 100644
--- a/programs/test/CMakeLists.txt
+++ b/programs/test/CMakeLists.txt
@@ -8,6 +8,10 @@
     set(libs ${libs} pkcs11-helper)
 endif(USE_PKCS11_HELPER_LIBRARY)
 
+if(ENABLE_ZLIB_SUPPORT)
+    set(libs ${libs} ${ZLIB_LIBRARIES})
+endif(ENABLE_ZLIB_SUPPORT)
+
 add_executable(selftest selftest.c)
 target_link_libraries(selftest ${libs})
 
diff --git a/programs/x509/CMakeLists.txt b/programs/x509/CMakeLists.txt
index 554d9a0..08a962a 100644
--- a/programs/x509/CMakeLists.txt
+++ b/programs/x509/CMakeLists.txt
@@ -6,6 +6,10 @@
     set(libs ${libs} pkcs11-helper)
 endif(USE_PKCS11_HELPER_LIBRARY)
 
+if(ENABLE_ZLIB_SUPPORT)
+    set(libs ${libs} ${ZLIB_LIBRARIES})
+endif(ENABLE_ZLIB_SUPPORT)
+
 add_executable(cert_app cert_app.c)
 target_link_libraries(cert_app ${libs})