not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kwin / CMakeLists.txt
blobd9233ce12f39018b6a64228bf014b37026f1b85c
1 ########### configure tests ###############
3 # KWIN_HAVE_COMPOSITING - whether any compositing support is available
4 if( X11_Xcomposite_FOUND AND X11_Xdamage_FOUND )
5     set( KWIN_HAVE_COMPOSITING 1 )
6 endif( X11_Xcomposite_FOUND AND X11_Xdamage_FOUND )
8 # KWIN_HAVE_OPENGL_COMPOSITING - whether OpenGL-based compositing support is available
9 if( KWIN_HAVE_COMPOSITING AND OPENGL_FOUND )
10     set( KWIN_HAVE_OPENGL_COMPOSITING 1 )
11 endif( KWIN_HAVE_COMPOSITING AND OPENGL_FOUND )
13 # KWIN_HAVE_XRENDER_COMPOSITING - whether XRender-based compositing support is available
14 if( KWIN_HAVE_COMPOSITING AND X11_Xrender_FOUND AND X11_Xfixes_FOUND )
15     set( KWIN_HAVE_XRENDER_COMPOSITING 1 )
16 endif( KWIN_HAVE_COMPOSITING AND X11_Xrender_FOUND AND X11_Xfixes_FOUND )
18 # safety
19 if( KWIN_HAVE_OPENGL_COMPOSITING OR KWIN_HAVE_XRENDER_COMPOSITING )
20     # ok
21 else( KWIN_HAVE_OPENGL_COMPOSITING OR KWIN_HAVE_XRENDER_COMPOSITING )
22     set( KWIN_HAVE_COMPOSITING ) # unset
23 endif( KWIN_HAVE_OPENGL_COMPOSITING OR KWIN_HAVE_XRENDER_COMPOSITING )
25 macro_log_feature(KWIN_HAVE_COMPOSITING "Compositing support" "X11 Compositing support"  "http://www.x.org/" FALSE "" "XComposite and XDamage extensions and OpenGL or XRender with XFixes are required for KWin compositing support")
27 macro_bool_to_01( OPENGL_FOUND KWIN_HAVE_OPENGL )
29 # for things that are also used by kwin libraries
30 configure_file(lib/kwinconfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/lib/kwinconfig.h )
31 # for kwin internal things
32 configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h )
35 ########### global ###############
37 include_directories(
38     ${CMAKE_CURRENT_BINARY_DIR}/lib
39     ${CMAKE_CURRENT_BINARY_DIR}
40     ${CMAKE_CURRENT_SOURCE_DIR}/lib
41     ${CMAKE_CURRENT_SOURCE_DIR}/effects
42     ${KDEBASE_WORKSPACE_SOURCE_DIR}/libs/kephal
43     )
46 add_subdirectory( lib ) 
47 add_subdirectory( killer )
48 add_subdirectory( kcmkwin )
49 add_subdirectory( clients )
50 add_subdirectory( data )
52 if( KWIN_HAVE_COMPOSITING )
53 add_subdirectory( effects )
54 endif( KWIN_HAVE_COMPOSITING )
56 ########### next target ###############
58 set(kwin_KDEINIT_SRCS
59    workspace.cpp 
60    client.cpp 
61    placement.cpp 
62    atoms.cpp 
63    utils.cpp 
64    layers.cpp 
65    main.cpp 
66    popupinfo.cpp 
67    tabbox.cpp 
68    options.cpp 
69    plugins.cpp 
70    events.cpp 
71    killwindow.cpp 
72    geometrytip.cpp 
73    sm.cpp 
74    group.cpp 
75    bridge.cpp 
76    manage.cpp 
77    notifications.cpp 
78    activation.cpp 
79    useractions.cpp 
80    geometry.cpp 
81    rules.cpp
82    composite.cpp
83    toplevel.cpp
84    unmanaged.cpp
85    scene.cpp
86    scene_basic.cpp
87    scene_xrender.cpp
88    scene_opengl.cpp
89    deleted.cpp
90    effects.cpp
91    compositingprefs.cpp
92    )
94 qt4_add_dbus_adaptor( kwin_KDEINIT_SRCS org.kde.KWin.xml workspace.h KWin::Workspace )
98 kde4_add_kdeinit_executable( kwin ${kwin_KDEINIT_SRCS})
100 target_link_libraries(kdeinit_kwin ${KDE4_KDEUI_LIBS} kephal kdecorations kwineffects ${X11_LIBRARIES})
102 if(OPENGL_FOUND)
103   target_link_libraries(kdeinit_kwin ${OPENGL_gl_LIBRARY})
104   # -ldl used by OpenGL code
105   find_library(DL_LIBRARY dl)
106   if (DL_LIBRARY)
107     target_link_libraries(kdeinit_kwin ${DL_LIBRARY})
108   endif(DL_LIBRARY)
109   # must be after opengl, to be initialized first by the linker
110   target_link_libraries(kdeinit_kwin kwinnvidiahack)
111 endif(OPENGL_FOUND)
113 if (X11_Xrandr_FOUND)
114   target_link_libraries(kdeinit_kwin ${X11_Xrandr_LIB})
115 endif (X11_Xrandr_FOUND)
116 if (X11_Xcomposite_FOUND)
117   target_link_libraries(kdeinit_kwin ${X11_Xcomposite_LIB})
118 endif (X11_Xcomposite_FOUND)
119 if (X11_Xdamage_FOUND)
120   target_link_libraries(kdeinit_kwin ${X11_Xdamage_LIB})
121 endif (X11_Xdamage_FOUND)
122 if (X11_Xrender_FOUND)
123   target_link_libraries(kdeinit_kwin ${X11_Xrender_LIB})
124 endif (X11_Xrender_FOUND)
125 if (X11_Xfixes_FOUND)
126   target_link_libraries(kdeinit_kwin ${X11_Xfixes_LIB})
127 endif (X11_Xfixes_FOUND)
129 install(TARGETS kdeinit_kwin ${INSTALL_TARGETS_DEFAULT_ARGS} )
130 install(TARGETS kwin         ${INSTALL_TARGETS_DEFAULT_ARGS} )
133 ########### next target ###############
135 set( kwinnvidiahack_LIB_SRCS 
136     nvidiahack.cpp )
139 kde4_add_library(kwinnvidiahack SHARED ${kwinnvidiahack_LIB_SRCS})
141 set_target_properties(kwinnvidiahack PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}  )
142 install(TARGETS kwinnvidiahack ${INSTALL_TARGETS_DEFAULT_ARGS} )
144 ########### install files ###############
146 install( FILES kwin.kcfg  DESTINATION  ${KCFG_INSTALL_DIR} )
147 install( FILES kwin.notifyrc  DESTINATION  ${DATA_INSTALL_DIR}/kwin )
148 install( FILES org.kde.KWin.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
150 kde4_install_icons( ${ICON_INSTALL_DIR} )