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