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