There won't ever be a Qt 4.9...
[quassel.git] / src / common / CMakeLists.txt
1 # Builds the common module
2
3 setup_qt_variables(Core Network)
4
5 set(SOURCES
6     aliasmanager.cpp
7     authhandler.cpp
8     backlogmanager.cpp
9     basichandler.cpp
10     bufferinfo.cpp
11     buffersyncer.cpp
12     bufferviewconfig.cpp
13     bufferviewmanager.cpp
14     cliparser.cpp
15     coreinfo.cpp
16     ctcpevent.cpp
17     event.cpp
18     eventmanager.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     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     protocols/legacy/legacypeer.cpp
44 )
45
46 set(MOC_HDRS
47     aliasmanager.h
48     authhandler.h
49     backlogmanager.h
50     basichandler.h
51     buffersyncer.h
52     bufferviewconfig.h
53     bufferviewmanager.h
54     coreinfo.h
55     eventmanager.h
56     identity.h
57     ignorelistmanager.h
58     internalpeer.h
59     ircchannel.h
60     irclisthelper.h
61     ircuser.h
62     network.h
63     networkconfig.h
64     peer.h
65     peerfactory.h
66     remotepeer.h
67     settings.h
68     signalproxy.h
69     syncableobject.h
70     transfer.h
71     transfermanager.h
72
73     protocols/legacy/legacypeer.h
74 )
75
76 set(HEADERS ${MOC_HDRS}
77     abstractcliparser.h
78     bufferinfo.h
79     cliparser.h
80     ctcpevent.h
81     event.h
82     ircevent.h
83     messageevent.h
84     networkevent.h
85     logger.h
86     message.h
87     protocol.h
88     types.h
89     util.h)
90
91 if (HAVE_QCA2)
92     set(SOURCES ${SOURCES} keyevent.cpp)
93     set(HEADERS ${HEADERS} keyevent.h)
94 endif(HAVE_QCA2)
95
96 if(APPLE)
97   set(SOURCES ${SOURCES} mac_utils.cpp)
98   set(HEADERS ${HEADERS} mac_utils.h)
99 endif(APPLE)
100
101 if(CMAKE_HOST_WIN32)
102     set(SOURCES ${SOURCES} logbacktrace_win.cpp)
103 endif(CMAKE_HOST_WIN32)
104 if(CMAKE_HOST_UNIX)
105     set(SOURCES ${SOURCES} logbacktrace_unix.cpp)
106 endif(CMAKE_HOST_UNIX)
107
108 include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QUASSEL_QT_INCLUDES})  # for version.inc and version.gen
109
110 if(NOT WITH_QT5)
111   qt4_wrap_cpp(MOC ${MOC_HDRS})
112 endif(NOT WITH_QT5)
113
114 set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES version.gen)
115
116 add_library(mod_common STATIC ${SOURCES} ${HEADERS} ${MOC})
117 set_target_properties(mod_common PROPERTIES COMPILE_FLAGS "${QUASSEL_QT_COMPILEFLAGS}")
118
119 if(APPLE)
120   target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation")
121 endif(APPLE)
122
123 target_link_libraries(mod_common ${CMAKE_DL_LIBS})