Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 772143)
+++ CMakeLists.txt	(working copy)
@@ -152,8 +152,13 @@
   macro_optional_add_subdirectory(knode)
 
   if(QGPGME_FOUND)
+    set(KMAIL_SUPPORTED 1)
+    message(STATUS "KMail support enabled.")
     macro_optional_add_subdirectory(kmail)
     add_subdirectory(plugins)
+  else(QGPGME_FOUND)
+    set(KMAIL_SUPPORTED 0)
+    message(STATUS "KMail support DISABLED (QGPGME not found).")
   endif(QGPGME_FOUND)
 
   macro_optional_add_subdirectory(kalarm)
@@ -166,15 +171,21 @@
   add_subdirectory(kdgantt1)
   macro_optional_add_subdirectory(strigi-analyzer)
   if(QGPGME_FOUND)
-    macro_optional_add_subdirectory(kmailcvt)
+     macro_optional_add_subdirectory(kmailcvt)
+     message(STATUS "KMailCVT support enabled.")
+  else(QGPGME_FOUND)
+     message(STATUS "KMailCVT support DISABLED (because KMail support is disabled).")
   endif(QGPGME_FOUND)
   macro_optional_add_subdirectory(knotes)
   macro_optional_add_subdirectory(console)
   macro_optional_add_subdirectory(kontact)
 
-  if(QGPGME_FOUND)
+  if(QGPGME_FOUND AND ${KMAIL_SUPPORTED})
      macro_optional_add_subdirectory(korganizer)
-  endif(QGPGME_FOUND)
+     message(STATUS "KOrganizer support enabled.")
+  else(QGPGME_FOUND AND ${KMAIL_SUPPORTED})
+     message(STATUS "KOrganizer support DISABLED (because KMail support is disabled).")
+  endif(QGPGME_FOUND AND ${KMAIL_SUPPORTED})
 
   if(NOT WIN32)
      macro_optional_find_package(Opensync)
Index: kontact/plugins/summary/CMakeLists.txt
===================================================================
--- kontact/plugins/summary/CMakeLists.txt	(revision 772143)
+++ kontact/plugins/summary/CMakeLists.txt	(working copy)
@@ -9,11 +9,15 @@
 
 set(kontact_summaryplugin_PART_SRCS summaryview_plugin.cpp summaryview_part.cpp dropwidget.cpp )
 
-qt4_add_dbus_interfaces(kontact_summaryplugin_PART_SRCS ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml)
+if(${KMAIL_SUPPORTED})
+   qt4_add_dbus_interfaces(kontact_summaryplugin_PART_SRCS ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml)
+endif(${KMAIL_SUPPORTED})
 
 
 kde4_add_plugin(kontact_summaryplugin ${kontact_summaryplugin_PART_SRCS})
-add_dependencies(kontact_summaryplugin kmail_xml)
+if(${KMAIL_SUPPORTED})
+   add_dependencies(kontact_summaryplugin kmail_xml)
+endif(${KMAIL_SUPPORTED})
 
 
 
Index: kontact/plugins/CMakeLists.txt
===================================================================
--- kontact/plugins/CMakeLists.txt	(revision 772143)
+++ kontact/plugins/CMakeLists.txt	(working copy)
@@ -1,12 +1,15 @@
 
-add_subdirectory( kaddressbook ) 
+if(${KMAIL_SUPPORTED})
+  add_subdirectory( kaddressbook ) 
+endif(${KMAIL_SUPPORTED})
+
 if(QGPGME_FOUND)
-if(NOT WIN32)
-add_subdirectory( kmail ) 
-endif(NOT WIN32)
-add_subdirectory( korganizer )
-add_subdirectory( summary )
-add_subdirectory( specialdates )
+  if(${KMAIL_SUPPORTED})
+    add_subdirectory( kmail ) 
+  endif(${KMAIL_SUPPORTED})
+  add_subdirectory( korganizer )
+  add_subdirectory( summary )
+  add_subdirectory( specialdates )
 add_subdirectory( planner )
 endif(QGPGME_FOUND)
 add_subdirectory( knotes ) 
Index: kalarm/CMakeLists.txt
===================================================================
--- kalarm/CMakeLists.txt	(revision 772143)
+++ kalarm/CMakeLists.txt	(working copy)
@@ -96,13 +96,17 @@
 qt4_add_dbus_adaptor( kalarm_bin_SRCS org.kde.kalarm.kalarm.xml dbushandler.h DBusHandler )
 qt4_add_dbus_adaptor( kalarm_bin_SRCS org.kde.kalarm.notify.xml daemon_p.h NotificationHandler )
 qt4_add_dbus_interfaces(kalarm_bin_SRCS kalarmd/org.kde.kalarm.kalarmd.Daemon.xml )
-qt4_add_dbus_interfaces(kalarm_bin_SRCS ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml )
+if (${KMAIL_SUPPORTED})
+   qt4_add_dbus_interfaces(kalarm_bin_SRCS ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml )
+endif (${KMAIL_SUPPORTED})
 
 kde4_add_kcfg_files(kalarm_bin_SRCS GENERATE_MOC kalarmconfig.kcfgc)
 
 if (UNIX)
 kde4_add_executable(kalarm_bin ${kalarm_bin_SRCS})
-add_dependencies(kalarm_bin kmail_xml)
+if (${KMAIL_SUPPORTED})
+   add_dependencies(kalarm_bin kmail_xml)
+endif (${KMAIL_SUPPORTED})
 
 set_target_properties(kalarm_bin PROPERTIES OUTPUT_NAME kalarm)
 
