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