[Piglit] [PATCH 07/10] CMakeLists: only set HAS_X11 if X11_FOUND
Daniel Kurtz
djkurtz at chromium.org
Wed Jan 15 03:10:02 PST 2014
It should be possible to have a Linux system without X11. In fact we
even probe to detect X11. Let's use the result to initialize HAS_X11.
This patch looks right to me, and works on my X11 Linux systesm. But, I
don't have a system to test either non-Linux nor Linux-without-X11.
Signed-off-by: Daniel Kurtz <djkurtz at chromium.org>
---
CMakeLists.txt | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3943d86..913a29d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,10 @@ INCLUDE (FindPkgConfig)
project (piglit)
find_package(X11)
+if(X11_FOUND)
+ set(PIGLIT_HAS_X11 True)
+ add_definitions(-DPIGLIT_HAS_X11)
+endif()
option(PIGLIT_BUILD_GL_TESTS "Build tests for OpenGL" ON)
@@ -97,9 +101,6 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(PIGLIT_HAS_GBM True)
add_definitions(-DPIGLIT_HAS_GBM)
- set(PIGLIT_HAS_X11 True)
- add_definitions(-DPIGLIT_HAS_X11)
-
pkg_check_modules(LIBDRM QUIET libdrm)
pkg_check_modules(LIBDRM_INTEL QUIET libdrm_intel)
pkg_check_modules(XCB_DRI2 QUIET xcb-dri2)
--
1.8.5.2
More information about the Piglit
mailing list