remove zlib from third_party, find it by cmake find_package()

This commit is contained in:
Chunting Gu
2020-09-01 14:41:01 +08:00
parent d49db1ec9c
commit 3d7b66f911
122 changed files with 50 additions and 43226 deletions
+25
View File
@@ -33,6 +33,31 @@ set(TARGET webcc)
add_library(${TARGET} STATIC ${SOURCES} ${HEADERS})
# Link to pthread for Linux.
# See: https://stackoverflow.com/a/29871891
if(UNIX)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(${TARGET} Threads::Threads)
endif()
# Boost
target_link_libraries(${TARGET} ${Boost_LIBRARIES})
# ZLIB
if(WEBCC_ENABLE_GZIP)
# The imported target ZLIB::ZLIB could be used instead.
target_link_libraries(${TARGET} ${ZLIB_LIBRARIES})
endif()
# OpenSSL
if(WEBCC_ENABLE_SSL)
target_link_libraries(${TARGET} ${OPENSSL_LIBRARIES})
if(WIN32)
target_link_libraries(${TARGET} crypt32)
endif()
endif()
# Install lib and header files.
# On Linux, if CMAKE_INSTALL_PREFIX is ~, the lib (libwebcc.a) will be installed
# to ~/lib and header files will be installed to ~/include.