THRIFT-3663 CMake cpp test fails to build on system without zlib
Client: Build (C++)
Patch: Nobuaki Sukegawa

This closes #890
diff --git a/lib/cpp/test/CMakeLists.txt b/lib/cpp/test/CMakeLists.txt
index 7fb2aa3..7c7e320 100644
--- a/lib/cpp/test/CMakeLists.txt
+++ b/lib/cpp/test/CMakeLists.txt
@@ -21,7 +21,6 @@
 set(Boost_USE_STATIC_LIBS ON) # Force the use of static boost test framework
 find_package(Boost 1.53.0 REQUIRED COMPONENTS chrono filesystem system thread unit_test_framework)
 include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
-include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
 
 if (WITH_DYN_LINK_TEST)
     add_definitions( -DBOOST_TEST_DYN_LINK )
@@ -127,6 +126,7 @@
 add_test(NAME TServerIntegrationTest COMMAND TServerIntegrationTest)
 
 if(WITH_ZLIB)
+include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
 add_executable(TransportTest TransportTest.cpp)
 target_link_libraries(TransportTest
     testgencpp