summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPekka Vuorela <pvuorela@iki.fi>2025-12-02 19:49:46 +0200
committerPekka Vuorela <pvuorela@iki.fi>2025-12-04 08:37:32 +0200
commit2c95c3e435f5379e4a3f1447d88a2e55aa6c718f (patch)
treeb4e8bdbe0c31bde5a6ef58796bfd1ac41d9a012c
parent4b1ff30c755a7cda17bd68f22f66b2e15c92674f (diff)
Use zlib with cmake build if available
Change-Id: I3297515d08a316d236061f0a3cfe85501f36617a Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
-rw-r--r--CMakeLists.txt6
-rw-r--r--src/plugins/messageservices/imap/CMakeLists.txt4
2 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 752ee069..451b33a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,12 @@ endif()
if(USE_HTML_PARSER)
find_package(Qt6 REQUIRED COMPONENTS Gui)
endif()
+
+find_package(ZLIB)
+if(NOT ZLIB_FOUND)
+ message("Zlib not found, IMAP COMPRESS support disabled")
+endif()
+
if(USE_ACCOUNTS_QT)
pkg_check_modules(LIBACCOUNTS REQUIRED accounts-qt6 IMPORTED_TARGET)
endif()
diff --git a/src/plugins/messageservices/imap/CMakeLists.txt b/src/plugins/messageservices/imap/CMakeLists.txt
index 3cba0484..098a22c2 100644
--- a/src/plugins/messageservices/imap/CMakeLists.txt
+++ b/src/plugins/messageservices/imap/CMakeLists.txt
@@ -37,6 +37,10 @@ target_link_libraries(imap
install(TARGETS imap
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt6/plugins/messagingframework/messageservices)
+if(ZLIB_FOUND)
+ target_compile_definitions(imap PRIVATE QT_QMF_HAVE_ZLIB)
+endif()
+
if(BUILD_TESTING)
add_custom_target(link_imap ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink imap/libimap.so ../libimap.so