Build effects twice - once with GL, once with GLES
This commit is contained in:
parent
c807e97e0a
commit
808c29109a
1 changed files with 31 additions and 6 deletions
|
@ -3,15 +3,34 @@ kde4_no_enable_final(kwineffects)
|
|||
|
||||
# Uncomment to have the test effects built as well
|
||||
#add_subdirectory( _test )
|
||||
macro( KWIN4_ADD_EFFECT_BACKEND name )
|
||||
kde4_add_plugin( ${name} ${ARGN} )
|
||||
target_link_libraries( ${name} kwineffects ${KDE4_KDEUI_LIBS} kephal ${KDE4_PLASMA_LIBS} ${X11_Xfixes_LIB} ${X11_Xcursor_LIB})
|
||||
if (X11_Xfixes_FOUND)
|
||||
target_link_libraries(${name} ${X11_Xfixes_LIB})
|
||||
endif (X11_Xfixes_FOUND)
|
||||
endmacro( KWIN4_ADD_EFFECT_BACKEND )
|
||||
|
||||
# Adds effect plugin with given name. Sources are given after the name
|
||||
macro( KWIN4_ADD_EFFECT name )
|
||||
kde4_add_plugin( kwin4_effect_${name} ${ARGN} )
|
||||
target_link_libraries( kwin4_effect_${name} kwineffects ${KDE4_KDEUI_LIBS} kephal ${KDE4_PLASMA_LIBS} ${X11_Xfixes_LIB} ${X11_Xcursor_LIB})
|
||||
if (X11_Xfixes_FOUND)
|
||||
target_link_libraries(kwin4_effect_${name} ${X11_Xfixes_LIB})
|
||||
endif (X11_Xfixes_FOUND)
|
||||
install( TARGETS kwin4_effect_${name} DESTINATION ${PLUGIN_INSTALL_DIR} )
|
||||
if(OPENGL_FOUND OR NOT(OPENGL_FOUND AND OPENGLES_FOUND))
|
||||
# OpenGL or neither OpenGL nor OpenGL ES - default set
|
||||
KWIN4_ADD_EFFECT_BACKEND(kwin4_effect_${name} ${ARGN})
|
||||
if(OPENGL_FOUND)
|
||||
target_link_libraries(kwin4_effect_${name} kwinglutils)
|
||||
set_target_properties(kwin4_effect_${name} PROPERTIES COMPILE_FLAGS -DKWIN_HAVE_OPENGL)
|
||||
endif(OPENGL_FOUND)
|
||||
install( TARGETS kwin4_effect_${name} DESTINATION ${PLUGIN_INSTALL_DIR} )
|
||||
endif(OPENGL_FOUND OR NOT(OPENGL_FOUND AND OPENGLES_FOUND))
|
||||
|
||||
|
||||
if(OPENGLES_FOUND)
|
||||
KWIN4_ADD_EFFECT_BACKEND(kwin4_effect_gles_${name} ${ARGN})
|
||||
# OpenGL ES gets into a different library
|
||||
target_link_libraries(kwin4_effect_gles_${name} kwinglesutils)
|
||||
set_target_properties(kwin4_effect_gles_${name} PROPERTIES COMPILE_FLAGS "-DKWIN_HAVE_OPENGL -DKWIN_HAVE_OPENGLES")
|
||||
install( TARGETS kwin4_effect_gles_${name} DESTINATION ${PLUGIN_INSTALL_DIR} )
|
||||
endif(OPENGLES_FOUND)
|
||||
endmacro( KWIN4_ADD_EFFECT )
|
||||
|
||||
macro( KWIN4_ADD_EFFECT_CONFIG name )
|
||||
|
@ -35,6 +54,12 @@ endmacro( KWIN4_ADD_EFFECT_CONFIG )
|
|||
macro( KWIN4_EFFECT_LINK_XRENDER name )
|
||||
if( KWIN_HAVE_XRENDER_COMPOSITING )
|
||||
target_link_libraries( kwin4_effect_${name} ${X11_Xrender_LIB} ${X11_LIBRARIES} kephal )
|
||||
|
||||
# if building for OpenGL and OpenGL ES we have two targets
|
||||
# TODO: if building for OpenGL ES we should not build XRender support
|
||||
if(OPENGLES_FOUND)
|
||||
target_link_libraries( kwin4_effect_gles_${name} ${X11_Xrender_LIB} ${X11_LIBRARIES} kephal )
|
||||
endif(OPENGLES_FOUND)
|
||||
endif( KWIN_HAVE_XRENDER_COMPOSITING )
|
||||
endmacro( KWIN4_EFFECT_LINK_XRENDER )
|
||||
|
||||
|
|
Loading…
Reference in a new issue