From d8d9cc49774faf66170790ea687c37584e5e7a51 Mon Sep 17 00:00:00 2001 From: Johannes Huber Date: Thu, 25 Feb 2010 16:24:58 +0100 Subject: [PATCH] included qca2 into build system --- CMakeLists.txt | 18 ++++++++++++++ INSTALL | 3 +++ cmake/modules/FindQCA2.cmake | 48 ++++++++++++++++++++++++++++++++++++ src/client/CMakeLists.txt | 4 +++ src/common/CMakeLists.txt | 7 ++++++ src/core/CMakeLists.txt | 4 +++ src/qtui/CMakeLists.txt | 4 +++ src/uisupport/CMakeLists.txt | 4 +++ 8 files changed, 92 insertions(+) create mode 100644 cmake/modules/FindQCA2.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index c1fee4a9..494d1ef4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 94e2000f..b7da160a 100644 --- 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=" Allow to choose which languages should be compiled into the binary. 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 index 00000000..43071d63 --- /dev/null +++ b/cmake/modules/FindQCA2.cmake @@ -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, +# +# 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) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index c8519070..53fc7612 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -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 diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 30eed022..e5a5e41c 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -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") diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 3b7e24e6..e786dab1 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -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 diff --git a/src/qtui/CMakeLists.txt b/src/qtui/CMakeLists.txt index d2b3852d..9a0b1209 100644 --- a/src/qtui/CMakeLists.txt +++ b/src/qtui/CMakeLists.txt @@ -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) diff --git a/src/uisupport/CMakeLists.txt b/src/uisupport/CMakeLists.txt index b038ead3..5afab319 100644 --- a/src/uisupport/CMakeLists.txt +++ b/src/uisupport/CMakeLists.txt @@ -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 -- 2.20.1