Fix compilation with OpenGL ES and without OpenGL

If we have OpenGL ES but not OpenGL the KWIN_HAVE_OPENGL is set
causing the first compile pass to fail as it tries to build
against OpenGL. As a solution the first pass links against
OpenGL ES if OpenGL is not found.

This means both kwin and kwin_gles are built against GLES.
This commit is contained in:
Martin Gräßlin 2011-08-03 16:39:36 +02:00
parent ebdb0f00ff
commit df75644817
2 changed files with 6 additions and 0 deletions

View file

@ -260,6 +260,9 @@ if(OPENGL_FOUND)
endif(DL_LIBRARY)
# must be after opengl, to be initialized first by the linker
target_link_libraries(kdeinit_kwin kwinnvidiahack)
elseif(OPENGLES_FOUND)
target_link_libraries(kdeinit_kwin ${kwinLibs} kwinglesutils ${OPENGLES_LIBRARIES} ${OPENGLES_EGL_LIBRARIES})
set_target_properties(kdeinit_kwin PROPERTIES COMPILE_FLAGS "-DKWIN_HAVE_OPENGL -DKWIN_HAVE_OPENGLES")
endif(OPENGL_FOUND)
install(TARGETS kdeinit_kwin ${INSTALL_TARGETS_DEFAULT_ARGS} )

View file

@ -16,6 +16,9 @@ macro( KWIN4_ADD_EFFECT name )
if(OPENGL_FOUND)
target_link_libraries(kwin4_effect_${name} kwinglutils)
set_target_properties(kwin4_effect_${name} PROPERTIES COMPILE_FLAGS -DKWIN_HAVE_OPENGL)
elseif(OPENGLES_FOUND)
target_link_libraries(kwin4_effect_${name} kwinglesutils)
set_target_properties(kwin4_effect_${name} PROPERTIES COMPILE_FLAGS "-DKWIN_HAVE_OPENGL -DKWIN_HAVE_OPENGLES")
endif(OPENGL_FOUND)
install( TARGETS kwin4_effect_${name} DESTINATION ${PLUGIN_INSTALL_DIR} )
endif(OPENGL_FOUND OR NOT(OPENGL_FOUND AND OPENGLES_FOUND))