From 8f2f126c31da1afc2877426acf9ab97d90b1d036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 14 Sep 2010 21:40:51 +0200 Subject: [PATCH] CMake check to find OpenGLES --- CMakeLists.txt | 12 ++++++++++++ lib/kwinconfig.h.cmake | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc612703bb..56f6ce5ba1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,13 @@ 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 ) +# KWIN_HAVE_OPENGLES_COMPOSITING - whether OpenGL ES-based compositing support is available +if( KWIN_HAVE_COMPOSITING AND OPENGLES_FOUND ) + set( KWIN_HAVE_OPENGL_COMPOSITING 1) + set( KWIN_HAVE_OPENGLES_COMPOSITING 1 ) + message("Comiling KWin for mobile.") +endif( KWIN_HAVE_COMPOSITING AND OPENGLES_FOUND ) + # safety if( KWIN_HAVE_OPENGL_COMPOSITING OR KWIN_HAVE_XRENDER_COMPOSITING ) # ok @@ -25,11 +32,16 @@ endif( KWIN_HAVE_OPENGL_COMPOSITING OR KWIN_HAVE_XRENDER_COMPOSITING ) 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") macro_bool_to_01( OPENGL_FOUND KWIN_HAVE_OPENGL ) +macro_bool_to_01( OPENGLES_FOUND KWIN_HAVE_OPENGLES ) if(OPENGL_FOUND) include_directories(${OPENGL_INCLUDE_DIR}) endif(OPENGL_FOUND) +if(OPENGLES_FOUND) + include_directories(${OPENGLES_INCLUDE_DIR}) +endif(OPENGLES_FOUND) + # for things that are also used by kwin libraries configure_file(lib/kwinconfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/lib/kwinconfig.h ) # for kwin internal things diff --git a/lib/kwinconfig.h.cmake b/lib/kwinconfig.h.cmake index b653e8d8b9..22405a585c 100644 --- a/lib/kwinconfig.h.cmake +++ b/lib/kwinconfig.h.cmake @@ -15,6 +15,15 @@ #undef KWIN_HAVE_OPENGL #endif +#if ${KWIN_HAVE_OPENGLES} +#define KWIN_HAVE_OPENGLES 1 +#ifndef KWIN_HAVE_OPENGL +#define KWIN_HAVE_OPENGL 1 +#endif +#else +#undef KWIN_HAVE_OPENGLES +#endif + /* These should be primarily used to detect what kind of compositing @@ -28,6 +37,9 @@ /* KWIN_HAVE_OPENGL_COMPOSITING - whether OpenGL-based compositing support is available */ #cmakedefine KWIN_HAVE_OPENGL_COMPOSITING +/* KWIN_HAVE_OPENGLES_COMPOSITING - whether OpenGL ES-based compositing support is available */ +#cmakedefine KWIN_HAVE_OPENGLES_COMPOSITING + /* KWIN_HAVE_XRENDER_COMPOSITING - whether XRender-based compositing support is available */ #cmakedefine KWIN_HAVE_XRENDER_COMPOSITING