Instantiate the QmlChatView instead of the QGV-based ChatView
[quassel.git] / CMakeLists.txt
index a0a34c0..8eba7ab 100644 (file)
@@ -10,6 +10,7 @@
 # -DWITH_LIBINDICATE=OFF : Disable libindicate support (Ayatana notifications)
 # -DWITH_KDE=ON          : Enable KDE4 support
 # -DWITH_CRYPT=OFF       : Disable encryption support
+# -DWITH_QML=ON          : Enable the QML-based UI (requires Qt 4.7+)
 # -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
@@ -46,6 +47,7 @@ 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 encryption support if present on system"  ON)
+option(WITH_QML      "Enable the QML-based UI"                          OFF)
 
 # 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
@@ -143,7 +145,11 @@ endif(WANT_MONO OR WANT_CORE)
 
 # GUI stuff needs some new features
 if(BUILD_GUI)
-  set(QT_MIN_VERSION "4.6.0")
+  if(WITH_QML)
+    set(QT_MIN_VERSION "4.7.4")
+  else(WITH_QML)
+    set(QT_MIN_VERSION "4.6.0")
+  endif(WITH_QML)
 else(BUILD_GUI)
   set(QT_MIN_VERSION "4.4.0")
 endif(BUILD_GUI)
@@ -205,6 +211,19 @@ if(BUILD_GUI)
       set(CLIENT_QT4_VARS ${CLIENT_QT4_VARS} DBUS)
       set(CLIENT_COMPILE_FLAGS "${CLIENT_COMPILE_FLAGS} -DQT_DBUS_LIB")
       set(HAVE_DBUS true)
+
+      # check if we have dbusmenu as well
+      find_package(DBusMenuQt)
+      if(DBUSMENUQT_FOUND)
+        message(STATUS "Enabling support for exporting the tray menu via D-Bus")
+        add_definitions(-DHAVE_DBUSMENU)
+        include_directories(${DBUSMENUQT_INCLUDE_DIR})
+        set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} ${DBUSMENUQT_LIBRARIES})
+        set(CLIENT_COMPILE_FLAGS "${CLIENT_COMPILE_FLAGS} ${DBUSMENUQT_DEFINITIONS}")
+      else(DBUSMENUQT_FOUND)
+        message(STATUS "Disabling support for exporting the tray menu via D-Bus")
+      endif(DBUSMENUQT_FOUND)
+
     else(QT_QTDBUS_FOUND)
       message(STATUS "QtDBus not found, disabling D-Bus support")
     endif(QT_QTDBUS_FOUND)
@@ -227,6 +246,21 @@ if(BUILD_GUI)
     message(STATUS "Not enabling WebKit support")
   endif(WITH_WEBKIT)
 
+  # Setup QML support
+  if(WITH_QML)
+    if(QT_QTDECLARATIVE_FOUND)
+      message(STATUS "Found QtDeclarative, enabling the QML-based UI")
+      add_definitions(-DHAVE_QML)
+      set(CLIENT_QT4_VARS ${CLIENT_QT4_VARS} DECLARATIVE)
+      set(CLIENT_COMPILE_FLAGS "${CLIENT_COMPILE_FLAGS} -DQT_DECLARATIVE_LIB")
+      set(HAVE_QML true)
+    else(QT_QTDECLARATIVE_FOUND)
+      message(STATUS "QtDeclarative not found, disabling the QML-based UI")
+    endif(QT_QTDECLARATIVE_FOUND)
+  else(WITH_QML)
+    message(STATUS "Not enabling the QML-based UI")
+  endif(WITH_QML)
+
   # Setup KDE4 support
   if(WITH_KDE)
     find_package(KDE4)
@@ -235,7 +269,7 @@ if(BUILD_GUI)
       include_directories(${KDE4_INCLUDES})
       add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS})
       set(HAVE_KDE 1)
-      set(QUASSEL_KDE_LIBRARIES ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBRARY} ${KDE4_SOLID_LIBS} knotifyconfig)
+      set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBRARY} ${KDE4_SOLID_LIBS} knotifyconfig)
       # We always use external icons for KDE4 support, since we use its iconloader rather than our own
       set(EMBED_DATA OFF)
     else(KDE4_FOUND)
@@ -252,6 +286,8 @@ if(BUILD_GUI)
       if(PHONON_FOUND)
         message(STATUS "Enabling Phonon support")
         add_definitions(-DHAVE_PHONON)
+        include_directories(${PHONON_INCLUDES})
+        set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} ${PHONON_LIBS})
         set(HAVE_PHONON true)
       else(PHONON_FOUND)
         message(STATUS "Phonon not found, disabling audio notifications")
@@ -268,6 +304,8 @@ if(BUILD_GUI)
       message(STATUS "Enabling Ayatana notification support")
       set(HAVE_INDICATEQT true)
       add_definitions(-DHAVE_INDICATEQT)
+      link_directories(${INDICATEQT_LIBRARY_DIRS})
+      set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} ${INDICATEQT_LIBRARIES})
     else(INDICATEQT_FOUND)
       message(STATUS "Disabling Ayatana notification support")
     endif(INDICATEQT_FOUND)
@@ -383,4 +421,5 @@ add_subdirectory(data)
 add_subdirectory(icons)
 add_subdirectory(pics)
 add_subdirectory(po)
+add_subdirectory(qml)
 add_subdirectory(src)