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