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