uisupport: Provide helpers for dealing with widget changes
[quassel.git] / src / uisupport / CMakeLists.txt
index 3d135d9..3b19471 100644 (file)
@@ -1,14 +1,7 @@
-# Builds the uisupport module
+quassel_add_module(UiSupport EXPORT)
 
-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
+target_sources(${TARGET} PRIVATE
+    aboutdata.cpp
     abstractbuffercontainer.cpp
     abstractitemview.cpp
     action.cpp
@@ -26,7 +19,6 @@ set(SOURCES
     fontselector.cpp
     graphicalui.cpp
     icon.cpp
-    iconloader.cpp
     multilineedit.cpp
     networkmodelcontroller.cpp
     nickview.cpp
@@ -37,58 +29,47 @@ set(SOURCES
     styledlabel.cpp
     tabcompleter.cpp
     toolbaractionprovider.cpp
+    treeviewtouch.cpp
     uisettings.cpp
     uistyle.cpp
-   )
+    widgethelpers.h
 
-set(MOC_HDRS
-    abstractbuffercontainer.h
-    abstractitemview.h
+    # needed for automoc
     abstractnotificationbackend.h
-    action.h
-    actioncollection.h
-    bufferhotlistfilter.h
-    bufferview.h
-    bufferviewfilter.h
-    bufferviewoverlayfilter.h
-    clearablelineedit.h
-    clickablelabel.h
-    colorbutton.h
-    contextmenuactionprovider.h
-    flatproxymodel.h
-    fontselector.h
-    graphicalui.h
-    iconloader.h
-    multilineedit.h
-    networkmodelcontroller.h
-    nickview.h
-    nickviewfilter.h
-    resizingstackedwidget.h
-    settingspage.h
-    styledlabel.h
-    tabcompleter.h
-    toolbaractionprovider.h
-    uistyle.h
-   )
+)
 
-set(HEADERS
-    clickable.h
-    icon.h
-    qssparser.h
-    uisettings.h
-   )
+target_link_libraries(${TARGET}
+    PUBLIC
+        Qt5::Core
+        Qt5::Gui
+        Qt5::Network
+        Qt5::Widgets
+        Quassel::Client
+        Quassel::Common
+)
 
-if(HAVE_KDE)
-    set(SOURCES ${SOURCES} kcmdlinewrapper.cpp)
-    set(HEADERS ${HEADERS} kcmdlinewrapper.h)
-endif(HAVE_KDE)
+if (EMBED_DATA)
+    set_property(SOURCE graphicalui.cpp APPEND PROPERTY COMPILE_DEFINITIONS EMBED_DATA)
+endif()
 
-qt4_wrap_cpp(MOC ${MOC_HDRS})
+if (WITH_KF5)
+    target_link_libraries(${TARGET}
+        PUBLIC
+            KF5::CoreAddons
+            KF5::TextWidgets
+            KF5::XmlGui
+    )
+endif()
 
-include_directories(${CMAKE_SOURCE_DIR}/src/common
-                    ${CMAKE_SOURCE_DIR}/src/client
-                    ${CMAKE_SOURCE_DIR}/src/qtui
-                    ${CMAKE_SOURCE_DIR}/src/uisupport)
+if (KF5Sonnet_FOUND)
+    target_link_libraries(${TARGET} PRIVATE KF5::SonnetUi)
+    target_compile_definitions(${TARGET} PRIVATE -DHAVE_SONNET)
+endif()
 
-add_library(mod_uisupport STATIC ${SOURCES} ${MOC} ${HEADERS})
-add_dependencies(mod_uisupport mod_common mod_client)
+target_link_if_exists(${TARGET}
+    PUBLIC
+        Quassel::Resource::HicolorIcons
+        Quassel::Resource::Icons
+        Quassel::Resource::IconThemes
+        Quassel::Resource::Pics
+)