[Piglit] [PATCH 6/6] cmake: Request GLUT only when Waffle is not used
groleo at gmail.com
groleo at gmail.com
Wed Oct 24 06:11:32 PDT 2012
From: Adrian Marius Negreanu <adrian.m.negreanu at intel.com>
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu at intel.com>
---
:100644 100644 b48fb5f... 9f1ca49... M CMakeLists.txt
CMakeLists.txt | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b48fb5f..9f1ca49 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,6 @@ INCLUDE (FindPkgConfig)
project (piglit)
find_package(TIFF)
-find_package(GLUT REQUIRED)
find_package(PNG)
find_package(X11)
@@ -46,6 +45,21 @@ if(PIGLIT_USE_WAFFLE)
add_definitions(-DPIGLIT_USE_WAFFLE)
include_directories(${WAFFLE_INCLUDE_DIR})
link_libraries(${WAFFLE_LIBRARY})
+else()
+ find_package(GLUT REQUIRED)
+ # The 'REQUIRED' above correctly produces an error for
+ # OpenGL and PNG, but there's a bug involving FindGLUT.cmake
+ # that fails to produce the error as of CMake 2.8.5.
+ #
+ # Instead, CMake keeps going and eventually spams
+ # the console with a message for every target that used
+ # e.g. the ${GLUT_INCLUDE_DIR} variable. So it
+ # prints a line for basically every single test in piglit.
+ #
+ # Work around the bug and error out quickly here instead.
+ if (NOT GLUT_FOUND)
+ message(FATAL_ERROR "GLUT library not found")
+ endif()
endif(PIGLIT_USE_WAFFLE)
if(PIGLIT_BUILD_GLES1_TESTS AND NOT PIGLIT_USE_WAFFLE)
@@ -78,20 +92,6 @@ IF(PIGLIT_BUILD_GLX_TESTS)
pkg_check_modules(GLPROTO REQUIRED glproto)
ENDIF()
-# The 'REQUIRED' above correctly produces an error for
-# OpenGL and PNG, but there's a bug involving FindGLUT.cmake
-# that fails to produce the error as of CMake 2.8.5.
-#
-# Instead, CMake keeps going and eventually spams
-# the console with a message for every target that used
-# e.g. the ${GLUT_INCLUDE_DIR} variable. So it
-# prints a line for basically every single test in piglit.
-#
-# Work around the bug and error out quickly here instead.
-if (NOT GLUT_FOUND)
- message(FATAL_ERROR "GLUT library not found")
-endif()
-
# Check for presence of Python 2.6 or greater.
foreach(python_cmd python2 python)
execute_process(
--
1.8.0
More information about the Piglit
mailing list