From df756448173e169122305c0be3792af669530dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 3 Aug 2011 16:39:36 +0200 Subject: [PATCH] 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. --- CMakeLists.txt | 3 +++ effects/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7efb982392..56d6130819 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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} ) diff --git a/effects/CMakeLists.txt b/effects/CMakeLists.txt index 00ad0c0ce4..3af7a6f365 100644 --- a/effects/CMakeLists.txt +++ b/effects/CMakeLists.txt @@ -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))