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