2008-01-03 15:22:19 +00:00
########### configure tests ###############
# KWIN_HAVE_COMPOSITING - whether any compositing support is available
if( X11_Xcomposite_FOUND AND X11_Xdamage_FOUND )
set( KWIN_HAVE_COMPOSITING 1 )
endif( X11_Xcomposite_FOUND AND X11_Xdamage_FOUND )
# KWIN_HAVE_OPENGL_COMPOSITING - whether OpenGL-based compositing support is available
if( KWIN_HAVE_COMPOSITING AND OPENGL_FOUND )
set( KWIN_HAVE_OPENGL_COMPOSITING 1 )
endif( KWIN_HAVE_COMPOSITING AND OPENGL_FOUND )
# KWIN_HAVE_XRENDER_COMPOSITING - whether XRender-based compositing support is available
if( KWIN_HAVE_COMPOSITING AND X11_Xrender_FOUND AND X11_Xfixes_FOUND )
set( KWIN_HAVE_XRENDER_COMPOSITING 1 )
endif( KWIN_HAVE_COMPOSITING AND X11_Xrender_FOUND AND X11_Xfixes_FOUND )
2010-09-14 19:40:51 +00:00
# KWIN_HAVE_OPENGLES_COMPOSITING - whether OpenGL ES-based compositing support is available
2010-12-04 15:22:06 +00:00
if( KWIN_HAVE_COMPOSITING AND OPENGLES_FOUND AND KWIN_BUILD_WITH_OPENGLES)
2010-09-14 19:40:51 +00:00
set( KWIN_HAVE_OPENGL_COMPOSITING 1)
set( KWIN_HAVE_OPENGLES_COMPOSITING 1 )
2010-12-04 15:22:06 +00:00
message("Compiling KWin for mobile.")
endif( KWIN_HAVE_COMPOSITING AND OPENGLES_FOUND AND KWIN_BUILD_WITH_OPENGLES )
2010-09-14 19:40:51 +00:00
2008-01-03 15:22:19 +00:00
# safety
if( KWIN_HAVE_OPENGL_COMPOSITING OR KWIN_HAVE_XRENDER_COMPOSITING )
# ok
else( KWIN_HAVE_OPENGL_COMPOSITING OR KWIN_HAVE_XRENDER_COMPOSITING )
set( KWIN_HAVE_COMPOSITING ) # unset
endif( KWIN_HAVE_OPENGL_COMPOSITING OR KWIN_HAVE_XRENDER_COMPOSITING )
2008-06-17 00:43:34 +00:00
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")
2008-01-03 15:32:37 +00:00
2008-01-03 15:22:19 +00:00
macro_bool_to_01( OPENGL_FOUND KWIN_HAVE_OPENGL )
2010-12-04 15:04:37 +00:00
macro_bool_to_01( KWIN_HAVE_OPENGLES_COMPOSITING KWIN_HAVE_OPENGLES )
2008-01-03 15:22:19 +00:00
2010-03-05 18:30:04 +00:00
if(OPENGL_FOUND)
include_directories(${OPENGL_INCLUDE_DIR})
endif(OPENGL_FOUND)
2010-12-04 15:04:37 +00:00
if(OPENGLES_FOUND AND KWIN_HAVE_OPENGLES_COMPOSITING)
2010-09-14 19:40:51 +00:00
include_directories(${OPENGLES_INCLUDE_DIR})
2010-12-04 15:04:37 +00:00
endif(OPENGLES_FOUND AND KWIN_HAVE_OPENGLES_COMPOSITING)
2010-09-14 19:40:51 +00:00
2011-04-29 13:33:52 +00:00
OPTION(KWIN_BUILD_DECORATIONS "Enable building of KWin decorations." ON)
2008-01-03 15:22:19 +00:00
# for things that are also used by kwin libraries
2011-02-19 08:58:44 +00:00
configure_file(libkwineffects/kwinconfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/libkwineffects/kwinconfig.h )
2008-01-03 15:22:19 +00:00
# for kwin internal things
configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h )
########### global ###############
2007-04-29 17:35:43 +00:00
include_directories(
2011-02-19 08:58:44 +00:00
${CMAKE_CURRENT_BINARY_DIR}/libkwineffects
2007-06-22 16:32:06 +00:00
${CMAKE_CURRENT_BINARY_DIR}
2011-02-19 08:58:44 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/libkwineffects
2011-02-19 08:34:20 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/libkdecorations
2007-04-29 17:35:43 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/effects
2009-09-13 11:36:45 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/tabbox
2008-11-15 15:31:07 +00:00
${KDEBASE_WORKSPACE_SOURCE_DIR}/libs/kephal
2010-05-11 20:30:20 +00:00
${KDEBASE_WORKSPACE_SOURCE_DIR}/libs/kworkspace
2007-04-29 17:35:43 +00:00
)
2011-02-19 08:34:20 +00:00
add_subdirectory( libkdecorations )
2011-02-19 08:58:44 +00:00
add_subdirectory( libkwineffects )
2007-06-22 16:32:06 +00:00
add_subdirectory( killer )
2010-05-13 17:59:34 +00:00
add_subdirectory( kcmkwin )
2011-04-28 14:18:15 +00:00
if( KWIN_BUILD_DECORATIONS )
add_subdirectory( clients )
endif( KWIN_BUILD_DECORATIONS )
2007-06-22 16:32:06 +00:00
add_subdirectory( data )
2010-12-04 11:32:50 +00:00
if( KWIN_HAVE_COMPOSITING )
2008-06-06 11:07:15 +00:00
add_subdirectory( effects )
2010-12-04 11:32:50 +00:00
endif( KWIN_HAVE_COMPOSITING )
2008-06-06 11:07:15 +00:00
2007-04-29 17:35:43 +00:00
########### next target ###############
set(kwin_KDEINIT_SRCS
workspace.cpp
client.cpp
2009-11-15 03:24:04 +00:00
clientgroup.cpp
2007-04-29 17:35:43 +00:00
placement.cpp
atoms.cpp
utils.cpp
layers.cpp
main.cpp
2009-09-13 11:36:45 +00:00
tabbox.cpp
tabbox/clientitemdelegate.cpp
tabbox/clientmodel.cpp
tabbox/desktopitemdelegate.cpp
tabbox/desktopmodel.cpp
tabbox/itemlayoutconfig.cpp
tabbox/tabboxconfig.cpp
tabbox/tabboxhandler.cpp
tabbox/tabboxview.cpp
2009-04-06 16:09:34 +00:00
desktopchangeosd.cpp
2007-04-29 17:35:43 +00:00
options.cpp
2011-04-28 09:16:27 +00:00
outline.cpp
2007-04-29 17:35:43 +00:00
plugins.cpp
events.cpp
killwindow.cpp
geometrytip.cpp
2011-03-27 10:33:07 +00:00
shadow.cpp
2007-04-29 17:35:43 +00:00
sm.cpp
group.cpp
bridge.cpp
manage.cpp
notifications.cpp
activation.cpp
useractions.cpp
geometry.cpp
rules.cpp
composite.cpp
toplevel.cpp
unmanaged.cpp
scene.cpp
scene_basic.cpp
scene_xrender.cpp
scene_opengl.cpp
2010-06-02 20:04:54 +00:00
lanczosfilter.cpp
2007-04-29 17:35:43 +00:00
deleted.cpp
effects.cpp
2007-09-18 13:59:06 +00:00
compositingprefs.cpp
2009-02-14 09:46:12 +00:00
desktoplayout.cpp
2009-04-22 17:29:56 +00:00
paintredirector.cpp
2010-04-25 16:43:14 +00:00
tile.cpp
tiling.cpp
tilinglayout.cpp
tilinglayoutfactory.cpp
2010-09-21 14:31:40 +00:00
#load the scripting related functions
scripting/scripting.cpp
scripting/workspace.cpp
scripting/client.cpp
scripting/meta.cpp
scripting/toplevel.cpp
scripting/windowinfo.cpp
scripting/s_clientgroup.cpp
scripting/workspaceproxy.cpp
scripting/chelate.cpp
scripting/timer.cpp
2010-04-25 16:43:14 +00:00
# tiling layouts
# spiral
#tilinglayouts/spiral/spiralfactory.cpp
tilinglayouts/spiral/spiral.cpp
# columns
#tilinglayouts/columns/columnsfactory.cpp
tilinglayouts/columns/columns.cpp
# floating
tilinglayouts/floating/floating.cpp
2007-04-29 17:35:43 +00:00
)
qt4_add_dbus_adaptor( kwin_KDEINIT_SRCS org.kde.KWin.xml workspace.h KWin::Workspace )
2010-06-11 14:26:41 +00:00
qt4_add_dbus_interface( kwin_KDEINIT_SRCS
${KDEBASE_WORKSPACE_SOURCE_DIR}/ksmserver/org.kde.KSMServerInterface.xml ksmserver_interface)
2010-06-02 20:04:54 +00:00
qt4_add_resources( kwin_KDEINIT_SRCS resources.qrc )
2007-04-29 17:35:43 +00:00
kde4_add_kdeinit_executable( kwin ${kwin_KDEINIT_SRCS})
2010-05-31 21:24:40 +00:00
target_link_libraries(kdeinit_kwin ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTXML_LIBRARY} ${QT_QTSCRIPT_LIBRARY} kephal kworkspace kdecorations kwineffects ${X11_LIBRARIES})
2008-04-25 20:37:59 +00:00
2010-12-04 15:04:37 +00:00
if(OPENGL_FOUND AND NOT KWIN_HAVE_OPENGLES_COMPOSITING)
2010-02-26 20:47:00 +00:00
add_subdirectory(opengltest)
2007-04-29 17:35:43 +00:00
target_link_libraries(kdeinit_kwin ${OPENGL_gl_LIBRARY})
# -ldl used by OpenGL code
2007-05-10 12:49:57 +00:00
find_library(DL_LIBRARY dl)
if (DL_LIBRARY)
target_link_libraries(kdeinit_kwin ${DL_LIBRARY})
endif(DL_LIBRARY)
2007-12-17 14:19:41 +00:00
# must be after opengl, to be initialized first by the linker
target_link_libraries(kdeinit_kwin kwinnvidiahack)
2010-12-04 15:04:37 +00:00
endif(OPENGL_FOUND AND NOT KWIN_HAVE_OPENGLES_COMPOSITING)
2010-11-28 15:06:46 +00:00
2010-12-04 15:04:37 +00:00
if(KWIN_HAVE_OPENGLES_COMPOSITING)
2010-11-28 15:06:46 +00:00
target_link_libraries(kdeinit_kwin ${OPENGLES_LIBRARIES} ${OPENGLES_EGL_LIBRARIES})
2010-12-04 15:04:37 +00:00
endif(KWIN_HAVE_OPENGLES_COMPOSITING)
2008-04-25 20:37:59 +00:00
2007-04-29 17:35:43 +00:00
if (X11_Xrandr_FOUND)
target_link_libraries(kdeinit_kwin ${X11_Xrandr_LIB})
endif (X11_Xrandr_FOUND)
if (X11_Xcomposite_FOUND)
target_link_libraries(kdeinit_kwin ${X11_Xcomposite_LIB})
endif (X11_Xcomposite_FOUND)
if (X11_Xdamage_FOUND)
target_link_libraries(kdeinit_kwin ${X11_Xdamage_LIB})
endif (X11_Xdamage_FOUND)
if (X11_Xrender_FOUND)
target_link_libraries(kdeinit_kwin ${X11_Xrender_LIB})
endif (X11_Xrender_FOUND)
if (X11_Xfixes_FOUND)
target_link_libraries(kdeinit_kwin ${X11_Xfixes_LIB})
endif (X11_Xfixes_FOUND)
2008-04-01 16:42:27 +00:00
install(TARGETS kdeinit_kwin ${INSTALL_TARGETS_DEFAULT_ARGS} )
2008-04-11 06:52:03 +00:00
install(TARGETS kwin ${INSTALL_TARGETS_DEFAULT_ARGS} )
2007-04-29 17:35:43 +00:00
2007-12-17 14:19:41 +00:00
########### next target ###############
set( kwinnvidiahack_LIB_SRCS
nvidiahack.cpp )
kde4_add_library(kwinnvidiahack SHARED ${kwinnvidiahack_LIB_SRCS})
set_target_properties(kwinnvidiahack PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
2010-10-01 12:36:28 +00:00
install(TARGETS kwinnvidiahack ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
2007-12-17 14:19:41 +00:00
2007-04-29 17:35:43 +00:00
########### install files ###############
install( FILES kwin.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES kwin.notifyrc DESTINATION ${DATA_INSTALL_DIR}/kwin )
2007-07-23 07:01:14 +00:00
install( FILES org.kde.KWin.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
2009-09-13 11:36:45 +00:00
install( FILES tabbox/DefaultTabBoxLayouts.xml DESTINATION ${DATA_INSTALL_DIR}/kwin )
2007-04-29 17:35:43 +00:00
kde4_install_icons( ${ICON_INSTALL_DIR} )