cmake: Autogenerate most of the .qrc resource files
[quassel.git] / src / client / CMakeLists.txt
index 7e171d2..6f4f669 100644 (file)
@@ -1,9 +1,6 @@
-# Builds the client module
+quassel_add_module(Client)
 
 
-# In Qt4, we still have some minor deps to QtGui: QItemSelectionModel, QSortFilterProxyModel
-# Still in Qt5: QAbstractItemView in BufferModel
-
-set(SOURCES
+target_sources(${TARGET} PRIVATE
     abstractmessageprocessor.cpp
     backlogrequester.cpp
     buffermodel.cpp
     abstractmessageprocessor.cpp
     backlogrequester.cpp
     buffermodel.cpp
@@ -38,13 +35,13 @@ set(SOURCES
     abstractui.h
 )
 
     abstractui.h
 )
 
-if (USE_QT5)
-    list(APPEND qt_modules Widgets)
-endif()
-
-qt_add_resources(SOURCES ${CLIENT_RCS})
-
-add_library(mod_client STATIC ${SOURCES})
-qt_use_modules(mod_client Network Core Gui ${qt_modules})
+target_link_libraries(${TARGET}
+    PUBLIC
+        Qt5::Core
+        Qt5::Gui
+        Qt5::Network
+        Qt5::Widgets  # QAbstractItemView in BufferModel
+        Quassel::Common
+)
 
 
-target_link_libraries(mod_client mod_common)
+target_link_if_exists(${TARGET} PUBLIC Quassel::Resource::Data)