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