included qca2 into build system
authorJohannes Huber <johu@gmx.de>
Thu, 25 Feb 2010 15:24:58 +0000 (16:24 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 22 Jul 2010 07:37:51 +0000 (09:37 +0200)
CMakeLists.txt
INSTALL
cmake/modules/FindQCA2.cmake [new file with mode: 0644]
src/client/CMakeLists.txt
src/common/CMakeLists.txt
src/core/CMakeLists.txt
src/qtui/CMakeLists.txt
src/uisupport/CMakeLists.txt

index c1fee4a..494d1ef 100644 (file)
@@ -9,6 +9,7 @@
 # -DWITH_PHONON=OFF      : Disable Phonon support (audio notifications)
 # -DWITH_LIBINDICATE=OFF : Disable libindicate support (Ayatana notifications)
 # -DWITH_KDE=ON          : Enable KDE4 support
+# -DWITH_CRYPT=OFF       : Disable crypt support
 # -DWITH_OXYGEN=(ON|OFF) : Whether to install Oxygen icons (default: yes, unless KDE > 4.3.0 is present and enabled)
 #
 # -DEMBED_DATA=ON        : Embed all data files in icons the binary, rather than installing them separately
@@ -44,6 +45,7 @@ option(WITH_WEBKIT   "Enable WebKit support (for link previews)"      ON)
 option(WITH_PHONON   "Enable Phonon support (for audio notifications)" ON)
 option(WITH_LIBINDICATE "Enable Ayatana notification support"           ON)
 option(WITH_KDE      "Enable KDE4 integration"                         OFF)
+option(WITH_CRYPT    "Enable crypt support if present on system"       ON)
 
 # We use icon paths from KDE 4.3.x, which are partially invalid on older and possibly
 # even on newer KDE versions. Do not disable this unless you are sure that your Quassel will
@@ -263,6 +265,22 @@ else(WITH_LIBINDICATE)
   set(INDICATEQT_LIBRARIES "")
 endif(WITH_LIBINDICATE)
 
+# Setup QtWebKit support
+if(WITH_CRYPT)
+  find_package(QCA2)
+  if(QCA2_FOUND)
+    message(STATUS "Found qca2, enabling crypt support")
+    add_definitions(-DHAVE_QCA2)
+    set(LINK_QCA2 QCA2)
+    set(HAVE_QCA2 true)
+    set(MOC_DEFINES ${MOC_DEFINES} -DHAVE_QCA2)
+  else(QCA2_FOUND)
+    message(STATUS "qca2 not found, disabling crypt support")
+  endif(QCA2_FOUND)
+else(WITH_CRYPT)
+  message(STATUS "Not enabling crypt support")
+endif(WITH_CRYPT)
+
 # Now set up install locations; those are set by KDE if integration is enabled
 if(NOT HAVE_KDE)
   if(WIN32)
diff --git a/INSTALL b/INSTALL
index 94e2000..b7da160 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -63,6 +63,9 @@ Quassel recognizes the following options:
 -DWITH_LIBINDICATE=OFF
     Disable support for Ayatana notifications (libindicate-qt)
 
+-DWITH_CRYPT=OFF
+    Disable crypt support
+
 -DLINGUAS="<languages">
     Allow to choose which languages should be compiled into the binary.
     <languages> is a space- or comma-separated list of language codes.
diff --git a/cmake/modules/FindQCA2.cmake b/cmake/modules/FindQCA2.cmake
new file mode 100644 (file)
index 0000000..43071d6
--- /dev/null
@@ -0,0 +1,48 @@
+# - Try to find QCA2 (Qt Cryptography Architecture 2)
+# Once done this will define
+#
+#  QCA2_FOUND - system has QCA2
+#  QCA2_INCLUDE_DIR - the QCA2 include directory
+#  QCA2_LIBRARIES - the libraries needed to use QCA2
+#  QCA2_DEFINITIONS - Compiler switches required for using QCA2
+#
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+
+# Copyright (c) 2006, Michael Larouche, <michael.larouche@kdemail.net>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(FindLibraryWithDebug)
+
+if (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
+
+  # in cache already
+  set(QCA2_FOUND TRUE)
+
+else (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
+
+
+  if (NOT WIN32)
+    find_package(PkgConfig)
+    pkg_check_modules(PC_QCA2 qca2)
+    set(QCA2_DEFINITIONS ${PC_QCA2_CFLAGS_OTHER})
+  endif (NOT WIN32)
+
+  find_library_with_debug(QCA2_LIBRARIES
+                  WIN32_DEBUG_POSTFIX d
+                  NAMES qca
+                  HINTS ${PC_QCA2_LIBDIR} ${PC_QCA2_LIBRARY_DIRS}
+                  )
+
+  find_path(QCA2_INCLUDE_DIR qca.h 
+            HINTS ${PC_QCA2_INCLUDEDIR} ${PC_QCA2_INCLUDE_DIRS}
+            PATH_SUFFIXES QtCrypto)
+
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(QCA2 QCA2_LIBRARIES QCA2_INCLUDE_DIR)
+
+  mark_as_advanced(QCA2_INCLUDE_DIR QCA2_LIBRARIES)
+
+endif (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
index c851907..53fc761 100644 (file)
@@ -6,6 +6,10 @@ set(QT_USE_QTNETWORK 1)
 set(QT_USE_QTDBUS 1)
 include(${QT_USE_FILE})
 
+if (QCA2_FOUND)
+  include_directories(${QCA2_INCLUDE_DIR})
+endif (QCA2_FOUND)
+
 set(SOURCES
     abstractmessageprocessor.cpp
     backlogrequester.cpp
index 30eed02..e5a5e41 100644 (file)
@@ -1,4 +1,7 @@
 # Builds the common module
+if (QCA2_FOUND)
+    include_directories(${QCA2_INCLUDE_DIR})
+endif (QCA2_FOUND)
 
 set(QT_DONT_USE_QTGUI 1)
 set(QT_USE_QTNETWORK 1)
@@ -79,6 +82,10 @@ if(APPLE)
   target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation")
 endif(APPLE)
 
+if (QCA2_FOUND)
+  target_link_libraries(mod_common ${QCA2_LIBRARIES})
+endif (QCA2_FOUND)
+
 if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
   find_library(libdl dl)
   if(NOT libdl MATCHES "NOTFOUND")
index 3b7e24e..e786dab 100644 (file)
@@ -6,6 +6,10 @@ set(QT_USE_QTSQL 1)
 set(QT_USE_QTSCRIPT 1)
 include(${QT_USE_FILE})
 
+if (QCA2_FOUND)
+  include_directories(${QCA2_INCLUDE_DIR})
+endif (QCA2_FOUND)
+
 set(SOURCES
     abstractsqlstorage.cpp
     core.cpp
index d2b3852..9a0b120 100644 (file)
@@ -11,6 +11,10 @@ if(HAVE_WEBKIT)
 endif(HAVE_WEBKIT)
 include(${QT_USE_FILE})
 
+if (QCA2_FOUND)
+  include_directories(${QCA2_INCLUDE_DIR})
+endif (QCA2_FOUND)
+
 if(INDICATEQT_FOUND)
   include_directories(${INDICATEQT_INCLUDE_DIRS})
 endif(INDICATEQT_FOUND)
index b038ead..5afab31 100644 (file)
@@ -4,6 +4,10 @@ set(QT_DONT_USE_QTGUI 0)
 set(QT_USE_QTNETWORK 1)
 include(${QT_USE_FILE})
 
+if (QCA2_FOUND)
+  include_directories(${QCA2_INCLUDE_DIR})
+endif (QCA2_FOUND)
+
 set(SOURCES
     abstractbuffercontainer.cpp
     abstractitemview.cpp