526d424d07ac72c5703c4dd5b09186a8f8ba06a4
[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     compressor.cpp
16     coreinfo.cpp
17     ctcpevent.cpp
18     event.cpp
19     eventmanager.cpp
20     identity.cpp
21     ignorelistmanager.cpp
22     internalpeer.cpp
23     ircchannel.cpp
24     ircevent.cpp
25     irclisthelper.cpp
26     ircuser.cpp
27     logger.cpp
28     message.cpp
29     messageevent.cpp
30     network.cpp
31     networkconfig.cpp
32     networkevent.cpp
33     peer.cpp
34     peerfactory.cpp
35     quassel.cpp
36     remotepeer.cpp
37     settings.cpp
38     signalproxy.cpp
39     syncableobject.cpp
40     transfer.cpp
41     transfermanager.cpp
42     util.cpp
43
44     protocols/datastream/datastreampeer.cpp
45     protocols/legacy/legacypeer.cpp
46
47     ../../3rdparty/miniz/miniz.c
48 )
49
50 set(MOC_HDRS
51     aliasmanager.h
52     authhandler.h
53     backlogmanager.h
54     basichandler.h
55     buffersyncer.h
56     bufferviewconfig.h
57     bufferviewmanager.h
58     compressor.h
59     coreinfo.h
60     eventmanager.h
61     identity.h
62     ignorelistmanager.h
63     internalpeer.h
64     ircchannel.h
65     irclisthelper.h
66     ircuser.h
67     network.h
68     networkconfig.h
69     peer.h
70     peerfactory.h
71     remotepeer.h
72     settings.h
73     signalproxy.h
74     syncableobject.h
75     transfer.h
76     transfermanager.h
77
78     protocols/datastream/datastreampeer.h
79     protocols/legacy/legacypeer.h
80 )
81
82 set(HEADERS ${MOC_HDRS}
83     abstractcliparser.h
84     bufferinfo.h
85     cliparser.h
86     ctcpevent.h
87     event.h
88     ircevent.h
89     messageevent.h
90     networkevent.h
91     logger.h
92     message.h
93     protocol.h
94     types.h
95     util.h)
96
97 if (HAVE_QCA2)
98     set(SOURCES ${SOURCES} keyevent.cpp)
99     set(HEADERS ${HEADERS} keyevent.h)
100 endif(HAVE_QCA2)
101
102 if(APPLE)
103   set(SOURCES ${SOURCES} mac_utils.cpp)
104   set(HEADERS ${HEADERS} mac_utils.h)
105 endif(APPLE)
106
107 if(CMAKE_HOST_WIN32)
108     set(SOURCES ${SOURCES} logbacktrace_win.cpp)
109 endif(CMAKE_HOST_WIN32)
110 if(CMAKE_HOST_UNIX)
111     set(SOURCES ${SOURCES} logbacktrace_unix.cpp)
112 endif(CMAKE_HOST_UNIX)
113
114 include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QUASSEL_QT_INCLUDES})  # for version.inc and version.gen
115
116 if(NOT WITH_QT5)
117   qt4_wrap_cpp(MOC ${MOC_HDRS})
118 endif(NOT WITH_QT5)
119
120 set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES version.gen)
121
122 add_library(mod_common STATIC ${SOURCES} ${HEADERS} ${MOC})
123 set_target_properties(mod_common PROPERTIES COMPILE_FLAGS "${QUASSEL_QT_COMPILEFLAGS}")
124
125 if(APPLE)
126   target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation")
127 endif(APPLE)
128
129 target_link_libraries(mod_common ${CMAKE_DL_LIBS})