aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAdrian Marius Negreanu <adrian.m.negreanu@intel.com>2012-10-24 16:11:32 +0300
committerChad Versace <chad.versace@linux.intel.com>2012-12-11 19:22:53 -0600
commit6bc04a5d68516275724442f6729f09dc86dda1d0 (patch)
tree6dcf98bf880971e0dd8209909338d6c15d9b2a69 /CMakeLists.txt
parent18d60cb4b07d382634095add24565ab17413d136 (diff)
downloadpiglit-6bc04a5d68516275724442f6729f09dc86dda1d0.tar.gz
cmake: Request GLUT only when Waffle is not used
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 16 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e01d456..689631de 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 REQUIRED)
find_package(X11)
@@ -47,6 +46,22 @@ if(PIGLIT_USE_WAFFLE)
add_definitions(-DPIGLIT_USE_WAFFLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WAFFLE_CFLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WAFFLE_CFLAGS}")
+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)
@@ -83,20 +98,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(