cmake: Remove build system support for Qt4/KDE4
[quassel.git] / src / common / CMakeLists.txt
1 # Builds the common module
2
3 set(SOURCES
4     abstractsignalwatcher.h
5     aliasmanager.cpp
6     authhandler.cpp
7     backlogmanager.cpp
8     basichandler.cpp
9     bufferinfo.cpp
10     buffersyncer.cpp
11     bufferviewconfig.cpp
12     bufferviewmanager.cpp
13     compressor.cpp
14     coreinfo.cpp
15     ctcpevent.cpp
16     dccconfig.cpp
17     event.cpp
18     eventmanager.cpp
19     expressionmatch.cpp
20     # expressionmatchtests.cpp
21     highlightrulemanager.cpp
22     identity.cpp
23     ignorelistmanager.cpp
24     internalpeer.cpp
25     ircchannel.cpp
26     ircevent.cpp
27     irclisthelper.cpp
28     ircuser.cpp
29     logger.cpp
30     logmessage.cpp
31     message.cpp
32     messageevent.cpp
33     network.cpp
34     networkconfig.cpp
35     networkevent.cpp
36     nickhighlightmatcher.cpp
37     peer.cpp
38     peerfactory.cpp
39     presetnetworks.cpp
40     qt5cliparser.cpp
41     quassel.cpp
42     remotepeer.cpp
43     settings.cpp
44     signalproxy.cpp
45     singleton.h
46     syncableobject.cpp
47     transfer.cpp
48     transfermanager.cpp
49     types.cpp
50     util.cpp
51
52     serializers/serializers.cpp
53
54     protocols/datastream/datastreampeer.cpp
55     protocols/legacy/legacypeer.cpp
56
57     # needed for automoc
58     irccap.h
59     protocol.h
60 )
61
62 if (QCA2-QT5_FOUND)
63     set(SOURCES ${SOURCES} keyevent.cpp)
64 endif()
65
66 if (ZLIB_FOUND)
67     add_definitions(-DHAVE_ZLIB)
68     include_directories(${ZLIB_INCLUDE_DIRS})
69 else()
70     set(SOURCES ${SOURCES} ../../3rdparty/miniz/miniz.c)
71 endif()
72
73 if (HAVE_SYSLOG)
74     add_definitions(-DHAVE_SYSLOG)
75 endif()
76
77 if (APPLE)
78     set(SOURCES ${SOURCES} mac_utils.cpp)
79 endif()
80
81 if (WIN32)
82     set(SOURCES ${SOURCES} logbacktrace_win.cpp windowssignalwatcher.cpp)
83 else()
84     if (EXECINFO_FOUND)
85         add_definitions(-DHAVE_EXECINFO)
86         include_directories(${EXECINFO_INCLUDES})
87     endif()
88     set(SOURCES ${SOURCES} logbacktrace_unix.cpp posixsignalwatcher.cpp)
89 endif()
90
91 qt5_add_resources(SOURCES ${COMMON_RCS})
92
93 add_library(mod_common STATIC ${SOURCES})
94 qt5_use_modules(mod_common Core Network)
95
96 if (APPLE)
97     target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation")
98 endif()
99
100 target_link_libraries(mod_common ${CMAKE_DL_LIBS} ${EXECINFO_LIBRARIES})
101
102 if(ZLIB_FOUND)
103     target_link_libraries(mod_common ${ZLIB_LIBRARIES})
104 endif()
105
106 # This is needed so translations are generated before trying to build the qrc.
107 # Should probably find a nicer solution with proper dependencies between the involved files, though...
108 add_dependencies(mod_common po)