From 55aa9d2f95802a0333f7aa249a3f18b9c1e3fc18 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Mon, 22 Dec 2008 08:21:29 +0100 Subject: [PATCH 1/1] Enable KDE support in the build system --- CMakeLists.txt | 19 +++++++++++++++++++ src/CMakeLists.txt | 11 ++++++++--- src/common/main.cpp | 2 +- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a7d0fc2..d643ac8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ # -DWITH_DBUS=OFF : Disable D-Bus support (dbus notifications) # -DWITH_WEBKIT=OFF : Disable WebKit support (link previews) # -DWITH_PHONON=OFF : Disable Phonon support (audio notifications) +# -DWITH_KDE=ON : Enable KDE4 support # -DOXYGEN_ICONS=(Builtin|External) : If "Builtin" (the default), compile our Oxygen Icon Theme subset into the binary # : If "External", we assume Oxygen is already installed on the system # -DQUASSEL_ICONS=(Builtin|External) : If "Builtin" (the default), put our own icons into the binary @@ -37,6 +38,7 @@ option(WITH_OPENSSL "Enable OpenSSL support if present on the system" ON) option(WITH_DBUS "Enable D-Bus support if present on the system" ON) option(WITH_WEBKIT "Enable WebKit support (for link previews)" ON) option(WITH_PHONON "Enable Phonon support (for audio notifications)" ON) +option(WITH_KDE "Enable KDE4 integration" OFF) option(STATIC "Enable static building (might not be portable)" OFF) option(DEPLOY "Mac OS X only! Adds required libs to bundle resources and create a dmg. Note: requires Qt to be built with 10.4u SDK" OFF) @@ -167,6 +169,23 @@ else(WITH_PHONON) message(STATUS "Disabling Phonon support") endif(WITH_PHONON) +# Setup KDE4 support +if(WITH_KDE) + find_package(KDE4) + if(KDE4_FOUND) + message(STATUS "Enabling KDE4 integration") + include_directories(${KDE4_INCLUDES}) + add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS}) + set(HAVE_KDE 1) + set(MOC_DEFINES ${MOC_DEFINES} -DHAVE_KDE) + set(QUASSEL_KDE_LIBRARIES ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBRARY}) + else(KDE4_FOUND) + message(STATUS "KDE4 not found, disabling KDE integration") + endif(KDE4_FOUND) +else(WITH_KDE) + message(STATUS "Disabling KDE4 integration") +endif(WITH_KDE) + # Set global buildflags # This is very much non-portable, so don't use -DSTATIC until you know what # you do. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a599e9d9..12103b8d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,6 +13,11 @@ if(WANT_QTCLIENT OR WANT_MONO) include_directories(client) include_directories(uisupport) include_directories(qtui) +# if(HAVE_KDE) +# add_subdirectory(kdeui) +# include_directories(kdeui) +# set(LINK_KDE mod_kdeui) +# endif(HAVE_KDE) endif(WANT_QTCLIENT OR WANT_MONO) include_directories(${CMAKE_CURRENT_BINARY_DIR}) # for version.gen @@ -49,8 +54,8 @@ if(WANT_QTCLIENT) set_target_properties(quasselclient PROPERTIES COMPILE_FLAGS "-DQT_GUI_LIB -DQT_NETWORK_LIB -DBUILD_QTUI" OUTPUT_NAME ../quasselclient) - target_link_libraries(quasselclient mod_qtui mod_uisupport mod_client mod_common - ${QUASSEL_QT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${PHONON_LIBS}) + target_link_libraries(quasselclient ${LINK_KDE} mod_qtui mod_uisupport mod_client mod_common + ${QUASSEL_QT_LIBRARIES} ${QUASSEL_KDE_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${PHONON_LIBS}) install(TARGETS quasselclient RUNTIME DESTINATION ${BIN_INSTALL_DIR}) endif(WANT_QTCLIENT) @@ -63,7 +68,7 @@ if(WANT_MONO) COMPILE_FLAGS "-DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DQT_SQL_LIB -DBUILD_MONO" OUTPUT_NAME ../quassel) target_link_libraries(quassel mod_qtui mod_uisupport mod_client mod_core mod_common - ${QUASSEL_QT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${PHONON_LIBS}) + ${QUASSEL_QT_LIBRARIES} ${QUASSEL_KDE_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${PHONON_LIBS}) install(TARGETS quassel RUNTIME DESTINATION ${BIN_INSTALL_DIR}) endif(WANT_MONO) diff --git a/src/common/main.cpp b/src/common/main.cpp index 9bfa885d..3fa06b3a 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -21,7 +21,7 @@ #include #ifdef BUILD_CORE -# include "../core/coreapplication.h" +# include "coreapplication.h" #elif defined BUILD_QTUI # include "qtuiapplication.h" #elif defined BUILD_MONO -- 2.20.1