OSDN Git Service

69aec95d5663c042b18c1201a24a9b438a7faf12
[kde/kde-workspace.git] / kwin / CMakeLists.txt
1 ########### configure tests ###############
2
3 option(KWIN_BUILD_OXYGEN "Enable building of default decoration Oxygen" ON)
4 option(KWIN_BUILD_KCMS "Enable building of KWin configuration modules." ON)
5 option(KWIN_BUILD_TABBOX "Enable building of KWin Tabbox functionality" ON)
6 option(KWIN_BUILD_SCREENEDGES "Enable building of KWin with screen edge support" ON)
7 option(KWIN_BUILD_KAPPMENU "Enable building of KWin with application menu support" ON)
8 option(KWIN_BUILD_COMPOSITE "Enable building of KWin with XRender Compositing support" ON)
9
10 # without dbusmenu-qt the functionality is useless
11 if(NOT DBUSMENUQT_FOUND)
12     set(KWIN_BUILD_KAPPMENU OFF)
13 endif()
14
15 include_directories(${XCB_INCLUDE_DIR})
16
17 # for kwin internal things
18 configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h)
19
20 ########### global ###############
21
22 include_directories(BEFORE
23     ${CMAKE_CURRENT_BINARY_DIR}/libkwineffects
24     ${CMAKE_CURRENT_BINARY_DIR}
25     ${CMAKE_CURRENT_SOURCE_DIR}/libkwineffects
26     ${CMAKE_CURRENT_SOURCE_DIR}/libkdecorations
27     ${CMAKE_CURRENT_SOURCE_DIR}/effects
28     ${CMAKE_CURRENT_SOURCE_DIR}/tabbox
29 )
30
31 add_subdirectory( libkdecorations )
32 add_subdirectory( libkwineffects )
33 add_subdirectory( killer )
34 if(KWIN_BUILD_KCMS)
35     add_subdirectory( kcmkwin )
36 endif()
37
38 add_subdirectory( clients )
39 add_subdirectory( tabbox )
40
41
42 # Install the KWin/Effect service type
43 install(FILES effects/kwineffect.desktop DESTINATION ${KDE4_SERVICETYPES_INSTALL_DIR})
44
45 # Create initial variables
46 set(kwin4_effect_builtins_sources)
47 set(kwin4_effect_builtins_config_sources effects/configs_builtins.cpp)
48 set(kwin4_effect_include_directories)
49
50 include( effects/kscreen/CMakeLists.txt )
51 include( effects/presentwindows/CMakeLists.txt )
52 include( effects/slidingpopups/CMakeLists.txt )
53 include( effects/taskbarthumbnail/CMakeLists.txt )
54 include( effects/dashboard/CMakeLists.txt )
55 include( effects/diminactive/CMakeLists.txt )
56 include( effects/dimscreen/CMakeLists.txt )
57 include( effects/highlightwindow/CMakeLists.txt )
58 include( effects/minimizeanimation/CMakeLists.txt )
59 include( effects/resize/CMakeLists.txt )
60 include( effects/showfps/CMakeLists.txt )
61 include( effects/showpaint/CMakeLists.txt )
62 include( effects/slide/CMakeLists.txt )
63 include( effects/slideback/CMakeLists.txt )
64 include( effects/thumbnailaside/CMakeLists.txt )
65 include( effects/windowgeometry/CMakeLists.txt )
66 include( effects/zoom/CMakeLists.txt )
67 include( effects/logout/CMakeLists.txt )
68 include( effects/magnifier/CMakeLists.txt )
69 include( effects/mousemark/CMakeLists.txt )
70 include( effects/snaphelper/CMakeLists.txt )
71 include( effects/trackmouse/CMakeLists.txt )
72 include( effects/startupfeedback/CMakeLists.txt )
73
74 kde4_add_plugin(kcm_kwin4_effect_builtins ${kwin4_effect_builtins_config_sources})
75 target_link_libraries(kcm_kwin4_effect_builtins kwineffects ${KDE4_KIO_LIBS} ${KDE4_KDEUI_LIBS})
76 install(TARGETS kcm_kwin4_effect_builtins DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
77
78 ########### next target ###############
79
80 set(kwin_SRCS
81    workspace.cpp 
82    dbusinterface.cpp
83    client.cpp 
84    client_machine.cpp
85    cursor.cpp
86    tabgroup.cpp
87    focuschain.cpp
88    netinfo.cpp
89    placement.cpp 
90    atoms.cpp 
91    utils.cpp 
92    layers.cpp 
93    main.cpp 
94    options.cpp 
95    decorations.cpp
96    events.cpp 
97    killwindow.cpp 
98    geometrytip.cpp 
99    screens.cpp
100    shadow.cpp
101    sm.cpp 
102    group.cpp 
103    bridge.cpp 
104    manage.cpp 
105    overlaywindow.cpp
106    activation.cpp 
107    useractions.cpp 
108    geometry.cpp 
109    rules.cpp
110    composite.cpp
111    toplevel.cpp
112    unmanaged.cpp
113    scene.cpp
114    scene_xrender.cpp
115    thumbnailitem.cpp
116    deleted.cpp
117    effects.cpp
118    compositingprefs.cpp
119    paintredirector.cpp
120    virtualdesktops.cpp
121    xcbutils.cpp
122 )
123
124 if(KWIN_BUILD_TABBOX)
125     set(kwin_SRCS
126         ${kwin_SRCS}
127         tabbox/tabbox.cpp
128         tabbox/clientmodel.cpp
129         tabbox/declarative.cpp
130         tabbox/desktopchain.cpp
131         tabbox/desktopmodel.cpp
132         tabbox/tabboxconfig.cpp
133         tabbox/tabboxhandler.cpp
134   )
135 endif()
136
137 if(KWIN_BUILD_SCREENEDGES)
138     set(kwin_SRCS
139         ${kwin_SRCS}
140         screenedge.cpp
141     )
142 endif()
143
144 if(KWIN_BUILD_KAPPMENU)
145     set(kwin_SRCS
146         ${kwin_SRCS}
147         appmenu.cpp
148     )
149 endif()
150
151 kde4_add_kcfg_files(kwin_SRCS settings.kcfgc)
152
153 qt4_add_dbus_adaptor(kwin_SRCS org.kde.KWin.xml dbusinterface.h KWin::DBusInterface)
154 qt4_add_dbus_adaptor(kwin_SRCS org.kde.kwin.Compositing.xml composite.h KWin::Compositor)
155 qt4_add_dbus_adaptor(kwin_SRCS org.kde.kwin.Effects.xml effects.h KWin::EffectsHandlerImpl)
156
157 qt4_add_dbus_interface(kwin_SRCS
158     ${CMAKE_SOURCE_DIR}/ksmserver/org.kde.KSMServerInterface.xml
159     ksmserver_interface
160 )
161 qt4_add_dbus_interface(kwin_SRCS
162     ${CMAKE_SOURCE_DIR}/ksmserver/screenlocker/dbus/org.freedesktop.ScreenSaver.xml
163     screenlocker_interface
164 )
165
166 ########### target link libraries ###############
167
168 if (NOT X11_xf86vmode_FOUND)
169     add_definitions(-DKWIN_NO_XF86VM)
170 endif()
171
172 add_executable(kwin ${kwin_SRCS} ${kwin4_effect_builtins_sources})
173
174 target_link_libraries(kwin
175     ${KDE4_KDEUI_LIBS}
176     ${KDE4_KDECLARATIVE_LIBS}
177     ${X11_X11_LIB}
178     ${X11_Xext_LIB}
179     ${X11_ICE_LIB}
180     ${X11_SM_LIB}
181     ${X11_Xcursor_LIB}
182     ${X11_Xrandr_LIB}
183     ${X11_Xdamage_LIB}
184     ${X11_Xrender_LIB}
185     ${X11_Xfixes_LIB}
186     ${X11_XCB_LIBRARIES}
187     ${XCB_XCB_LIBRARIES}
188     ${XCB_XFIXES_LIBRARIES}
189     ${XCB_DAMAGE_LIBRARIES}
190     ${XCB_COMPOSITE_LIBRARIES}
191     ${XCB_SHAPE_LIBRARIES}
192     ${XCB_SYNC_LIBRARIES}
193     ${XCB_RENDER_LIBRARIES}
194     ${XCB_RANDR_LIBRARIES}
195     ${XCB_KEYSYMS_LIBRARIES}
196     kdecorations
197     kwineffects
198 )
199
200 if(X11_xf86vmode_FOUND)
201     target_link_libraries(kwin ${X11_Xxf86vm_LIB})
202 endif()
203
204 install(TARGETS kwin ${INSTALL_TARGETS_DEFAULT_ARGS})
205
206 ########### install files ###############
207
208 install(FILES kwin.kcfg DESTINATION ${KDE4_KCFG_INSTALL_DIR})
209 install(FILES kwin.notifyrc DESTINATION ${KDE4_DATA_INSTALL_DIR}/kwin)
210 install(FILES org.kde.KWin.xml DESTINATION ${KDE4_DBUS_INTERFACES_INSTALL_DIR})
211
212 kde4_install_icons(${KDE4_ICON_INSTALL_DIR})
213
214 if(ENABLE_TESTING)
215     add_subdirectory(tests)
216 endif()