summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Watkins <travis.watkins@linaro.org>2011-06-13 16:22:21 -0500
committerTravis Watkins <travis.watkins@linaro.org>2011-08-03 14:01:34 +0100
commite31d26b91875079c789d1997a444b75b39beee8a (patch)
treefa5818f06f77914720ca19222e86b1e7635b3c33
parent016c45dd0e386514b7da0dce31b2d7e9f3f028f9 (diff)
downloadmobileperf-e31d26b91875079c789d1997a444b75b39beee8a.tar.gz
mobileperf-e31d26b91875079c789d1997a444b75b39beee8a.tar.bz2
add build flag for GLESv2
Instead of automatically building for GLESv2 when the headers are found use a build flag.
-rw-r--r--cmake/CompizCommon.cmake12
-rw-r--r--cmake/base.cmake1
-rw-r--r--cmake/plugin_extensions/CompizOpenGLFixups.cmake11
-rw-r--r--plugins/opengl/CMakeLists.txt7
4 files changed, 21 insertions, 10 deletions
diff --git a/cmake/CompizCommon.cmake b/cmake/CompizCommon.cmake
index ba84d8d..efaabb8 100644
--- a/cmake/CompizCommon.cmake
+++ b/cmake/CompizCommon.cmake
@@ -18,6 +18,7 @@ cmake_policy (SET CMP0011 OLD)
set (CMAKE_SKIP_RPATH FALSE)
+option (BUILD_GLES "Build against GLESv2 instead of GL" OFF)
option (COMPIZ_BUILD_WITH_RPATH "Leave as ON unless building packages" ON)
option (COMPIZ_RUN_LDCONFIG "Leave OFF unless you need to run ldconfig after install")
option (COMPIZ_PACKAGING_ENABLED "Enable to manually set prefix, exec_prefix, libdir, includedir, datadir" OFF)
@@ -70,6 +71,17 @@ elseif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.bzr)
set(IS_BZR_REPO 0)
endif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.bzr)
+set (USE_GLES ${BUILD_GLES})
+
+if (USE_GLES)
+ find_package(OpenGLES2)
+
+ if (NOT OPENGLES2_FOUND)
+ set (USE_GLES 0)
+ message (SEND_ERROR "OpenGLESv2 not found")
+ endif (NOT OPENGLES2_FOUND)
+endif (USE_GLES)
+
function (compiz_ensure_linkage)
find_program (LDCONFIG_EXECUTABLE ldconfig)
mark_as_advanced (FORCE LDCONFIG_EXECUTABLE)
diff --git a/cmake/base.cmake b/cmake/base.cmake
index 9aa7765..9783ac4 100644
--- a/cmake/base.cmake
+++ b/cmake/base.cmake
@@ -24,6 +24,7 @@ function (_print_configure_results)
compiz_print_configure_header ("Compiz")
compiz_color_message ("\n${_escape}[4mOptional features:${_escape}[0m\n")
+ compiz_print_result_message ("GLESv2" USE_GLES)
compiz_print_result_message ("gtk window decorator" USE_GTK)
compiz_print_result_message ("metacity theme support" USE_METACITY)
compiz_print_result_message ("gconf schemas" USE_GCONF)
diff --git a/cmake/plugin_extensions/CompizOpenGLFixups.cmake b/cmake/plugin_extensions/CompizOpenGLFixups.cmake
index 85ef4eb..053ff15 100644
--- a/cmake/plugin_extensions/CompizOpenGLFixups.cmake
+++ b/cmake/plugin_extensions/CompizOpenGLFixups.cmake
@@ -1,12 +1,11 @@
-find_package (OpenGLES2)
# modify pkg-config libs for opengl based on if we found GLES or not
if (${COMPIZ_CURRENT_PLUGIN} STREQUAL "opengl")
- if (OPENGLES2_FOUND)
+ if (USE_GLES)
set (PKGCONFIG_LIBS "-lGLESv2 -lEGL")
- else (OPENGLES2_FOUND)
+ else (USE_GLES)
set (PKGCONFIG_LIBS "-lGL")
- endif (OPENGLES2_FOUND)
+ endif (USE_GLES)
endif (${COMPIZ_CURRENT_PLUGIN} STREQUAL "opengl")
# if plugin is using opengl plugin check for GLES library and set correct define
@@ -14,10 +13,10 @@ if (NOT "${${_PLUGIN}_PLUGINDEPS}" STREQUAL "")
string (REGEX MATCH "opengl" opengl_found ${${_PLUGIN}_PLUGINDEPS})
if (opengl_found STREQUAL "opengl")
- if (OPENGLES2_FOUND)
+ if (USE_GLES)
set (${_PLUGIN}_CFLAGSADD ${${_PLUGIN}_CFLAGSADD} " -DUSE_GLES")
string (REPLACE ";" " " ${_PLUGIN}_CFLAGSADD ${${_PLUGIN}_CFLAGSADD})
- endif (OPENGLES2_FOUND)
+ endif (USE_GLES)
endif (opengl_found STREQUAL "opengl")
endif (NOT "${${_PLUGIN}_PLUGINDEPS}" STREQUAL "")
diff --git a/plugins/opengl/CMakeLists.txt b/plugins/opengl/CMakeLists.txt
index 68d805f..3274c2a 100644
--- a/plugins/opengl/CMakeLists.txt
+++ b/plugins/opengl/CMakeLists.txt
@@ -16,13 +16,12 @@ install (
DESTINATION ${COMPIZ_DESTDIR}${compiz_metadatadir}
)
-find_package (OpenGLES2)
-if (OPENGLES2_FOUND)
+if (USE_GLES)
compiz_plugin(opengl PLUGINDEPS composite CFLAGSADD -DUSE_GLES LIBRARIES ${OPENGLES2_LIBRARIES} INCDIRS ${OPENGLES2_INCLUDE_DIR})
-else (OPENGLES2_FOUND)
+else (USE_GLES)
find_package (OpenGL)
if (OPENGL_FOUND)
compiz_plugin(opengl PLUGINDEPS composite LIBRARIES ${OPENGL_gl_LIBRARY} INCDIRS ${OPENGL_INCLUDE_DIR})
endif (OPENGL_FOUND)
-endif (OPENGLES2_FOUND)
+endif (USE_GLES)