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