aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Podsvirov <konstantin@podsvirov.pro>2016-07-28 01:28:49 +0300
committerKonstantin Podsvirov <konstantin@podsvirov.pro>2016-07-28 01:28:49 +0300
commit38c5f2f3e6130ba79056480ce0f5149aa5dca38e (patch)
tree2ab113d28d1e8ce0f5a869e299e72cc5771f2ca4
parente7982e409deab9cb4390dd574441604e846caf7f (diff)
downloadprotobuf-38c5f2f3e6130ba79056480ce0f5149aa5dca38e.tar.gz
protobuf-38c5f2f3e6130ba79056480ce0f5149aa5dca38e.tar.bz2
protobuf-38c5f2f3e6130ba79056480ce0f5149aa5dca38e.zip
CMake: Link to ZLIB only if protobuf_WITH_ZLIB enabled
-rw-r--r--cmake/libprotobuf.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake
index 8930c1ca..26e1f356 100644
--- a/cmake/libprotobuf.cmake
+++ b/cmake/libprotobuf.cmake
@@ -56,7 +56,10 @@ set(libprotobuf_files
add_library(libprotobuf ${protobuf_SHARED_OR_STATIC}
${libprotobuf_lite_files} ${libprotobuf_files})
-target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES})
+target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT})
+if(protobuf_WITH_ZLIB)
+ target_link_libraries(libprotobuf ${ZLIB_LIBRARIES})
+endif()
target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src)
if(MSVC AND protobuf_BUILD_SHARED_LIBS)
target_compile_definitions(libprotobuf