aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2012-09-22 17:42:46 +0200
committerChad Versace <chad.versace@linux.intel.com>2012-10-09 19:08:30 -0700
commite84526ebad70f5cdb052f7d78d581556b548b969 (patch)
tree0eccd1311c15fac190a772933f6212a330e2165e /CMakeLists.txt
parent3cff928445f799e4a148d195fe0efd9d77ddc754 (diff)
downloadpiglit-e84526ebad70f5cdb052f7d78d581556b548b969.tar.gz
cmake: Define cmake flags and feature macros for X11, GLX, EGL
On Linux, unconditionally set the following internal CMake flags to true: PIGLIT_HAS_X11 PIGLIT_HAS_GLX 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. Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Paul Berry <stereotype441@gmail.com> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b30f483e..792f2a4f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,7 +42,12 @@ if(PIGLIT_BUILD_CL_TESTS)
endif(PIGLIT_BUILD_CL_TESTS)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(PIGLIT_HAS_X11 True)
add_definitions(-DPIGLIT_HAS_X11)
+
+ set(PIGLIT_HAS_GLX True)
+ add_definitions(-DPIGLIT_HAS_GLX)
+
option(PIGLIT_BUILD_GLX_TESTS "Build tests that require GLX" ON)
ELSE()
option(PIGLIT_BUILD_GLX_TESTS "Build tests that require GLX" OFF)
@@ -199,6 +204,12 @@ FIND_LIBRARY(OPENGL_egl_LIBRARY
NAMES EGL
PATHS /usr/lib
)
+
+if(OPENGL_egl_LIBRARY)
+ set(PIGLIT_HAS_EGL True)
+ add_definitions(-DPIGLIT_HAS_EGL)
+endif()
+
find_library(OPENGL_gles1_LIBRARY NAMES GLESv1_CM)
find_library(OPENGL_gles2_LIBRARY NAMES GLESv2)