737a42c8382a5d8d7b424b311845dc1c3921f7eb
[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     quassel.cpp
41     remotepeer.cpp
42     settings.cpp
43     signalproxy.cpp
44     singleton.h
45     syncableobject.cpp
46     transfer.cpp
47     transfermanager.cpp
48     types.cpp
49     util.cpp
50
51     serializers/serializers.cpp
52
53     protocols/datastream/datastreampeer.cpp
54     protocols/legacy/legacypeer.cpp
55
56     # needed for automoc
57     irccap.h
58     protocol.h
59 )
60
61 if (QCA2-QT5_FOUND)
62     set(SOURCES ${SOURCES} keyevent.cpp)
63 endif()
64
65 if (HAVE_SYSLOG)
66     add_definitions(-DHAVE_SYSLOG)
67 endif()
68
69 if (APPLE)
70     set(SOURCES ${SOURCES} mac_utils.cpp)
71 endif()
72
73 if (WIN32)
74     set(SOURCES ${SOURCES} logbacktrace_win.cpp windowssignalwatcher.cpp)
75 else()
76     if (EXECINFO_FOUND)
77         add_definitions(-DHAVE_EXECINFO)
78         include_directories(${EXECINFO_INCLUDES})
79     endif()
80     set(SOURCES ${SOURCES} logbacktrace_unix.cpp posixsignalwatcher.cpp)
81 endif()
82
83 qt5_add_resources(SOURCES ${COMMON_RCS})
84
85 add_library(mod_common STATIC ${SOURCES})
86 qt5_use_modules(mod_common Core Network)
87
88 if (APPLE)
89     target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation")
90 endif()
91
92 target_link_libraries(mod_common ${CMAKE_DL_LIBS} ${EXECINFO_LIBRARIES} ZLIB::ZLIB)
93
94 # This is needed so translations are generated before trying to build the qrc.
95 # Should probably find a nicer solution with proper dependencies between the involved files, though...
96 add_dependencies(mod_common po)