aboutsummaryrefslogtreecommitdiff
path: root/cmake/libprotobuf.cmake
diff options
context:
space:
mode:
authorFeng Xiao <xiaofeng@google.com>2016-08-03 11:03:15 -0700
committerGitHub <noreply@github.com>2016-08-03 11:03:15 -0700
commit0dca3cc5d642590d4c2bc75ce15e0c2ca31bcc87 (patch)
tree1db74a4f563c4bea6378bc10d136167393883044 /cmake/libprotobuf.cmake
parentdedd8aec0d87e3d6df511a881ca15f51b3c8f487 (diff)
parenteefd1fdd488eba88834a41d1008e0a8f1ae2a41c (diff)
downloadprotobuf-0dca3cc5d642590d4c2bc75ce15e0c2ca31bcc87.tar.gz
protobuf-0dca3cc5d642590d4c2bc75ce15e0c2ca31bcc87.tar.bz2
protobuf-0dca3cc5d642590d4c2bc75ce15e0c2ca31bcc87.zip
Merge pull request #1865 from podsvirov/topic-cmake-project
CMake: Improvements and Bugfixes
Diffstat (limited to 'cmake/libprotobuf.cmake')
-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