From 82da24205335050569192e2c7b2427f372aad9b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 17 Nov 2011 15:45:10 +0000 Subject: [PATCH] Allow to enable/disable EGL support. As done with GUI, to avoid automagic dependencies. --- CMakeLists.txt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57b76d1..8dd547d 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,8 @@ endif () # prescribed in http://www.gentoo.org/proj/en/qa/automagic.xml set (ENABLE_GUI "AUTO" CACHE STRING "Enable Qt GUI.") +set (ENABLE_EGL "AUTO" CACHE STRING "Enable EGL support.") + ############################################################################## # Find dependencies @@ -49,10 +51,17 @@ else () include_directories (${X11_INCLUDE_DIR}) - pkg_check_modules (EGL egl) - if (EGL_FOUND) - include_directories (${EGL_INCLUDE_DIR}) - add_definitions (-DHAVE_EGL) + if (ENABLE_EGL) + if (NOT ENABLE_EGL STREQUAL "AUTO") + set (REQUIRE_EGL REQUIRED) + endif () + pkg_check_modules (EGL egl ${REQUIRE_EGL}) + if (EGL_FOUND) + include_directories (${EGL_INCLUDE_DIR}) + add_definitions (-DHAVE_EGL) + endif () + else () + set (EGL_FOUND 0) endif () endif () -- 2.7.4