THRIFT-3873: fix various compiler warnings and overflow errors
THRIFT-3847: change VERSION to PACKAGE_VERSION to avoid conflicts with third party or OS headers

This closes #1128
diff --git a/tutorial/cpp/CMakeLists.txt b/tutorial/cpp/CMakeLists.txt
index 1feec2c..8634b41 100644
--- a/tutorial/cpp/CMakeLists.txt
+++ b/tutorial/cpp/CMakeLists.txt
@@ -44,9 +44,13 @@
 add_executable(TutorialServer CppServer.cpp)
 target_link_libraries(TutorialServer tutorialgencpp)
 LINK_AGAINST_THRIFT_LIBRARY(TutorialServer thrift)
-target_link_libraries(TutorialServer ${ZLIB_LIBRARIES})
+if (ZLIB_FOUND)
+  target_link_libraries(TutorialServer ${ZLIB_LIBRARIES})
+endif ()
 
 add_executable(TutorialClient CppClient.cpp)
 target_link_libraries(TutorialClient tutorialgencpp)
 LINK_AGAINST_THRIFT_LIBRARY(TutorialClient thrift)
-target_link_libraries(TutorialClient ${ZLIB_LIBRARIES})
+if (ZLIB_FOUND)
+  target_link_libraries(TutorialClient ${ZLIB_LIBRARIES})
+endif ()