[Piglit] [PATCH 14/23] cmake: Define cmake flags and feature macros for X11, GLX, EGL

Chad Versace chad.versace at linux.intel.com
Fri Sep 28 10:45:00 PDT 2012

On Linux, unconditionally set the following internal CMake flags to true:
Also define feature macros with the same names.

On all systems, if libEGL is found, then do the same for PIGLIT_HAS_EGL.

The CMake flags will allow us to selectively add certain files to
libpiglitutil_gl*. The flags and macros are used in a following commit.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
 CMakeLists.txt | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 224aa18..bc87d4d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,7 +42,12 @@ if(PIGLIT_BUILD_CL_TESTS)
+	set(PIGLIT_HAS_X11 True)
+        set(PIGLIT_HAS_GLX True)
+        add_definitions(-DPIGLIT_HAS_GLX)
 	option(PIGLIT_BUILD_GLX_TESTS "Build tests that require GLX" ON)
 	option(PIGLIT_BUILD_GLX_TESTS "Build tests that require GLX" OFF)
@@ -191,6 +196,12 @@ FIND_LIBRARY(OPENGL_egl_LIBRARY
       NAMES EGL
       PATHS /usr/lib
+    set(PIGLIT_HAS_EGL True)
+    add_definitions(-DPIGLIT_HAS_EGL)
 find_library(OPENGL_gles1_LIBRARY NAMES GLESv1_CM)
 find_library(OPENGL_gles2_LIBRARY NAMES GLESv2)

More information about the Piglit mailing list