[Piglit] [PATCH 17/18] cmake: Use glut_waffle if USE_WAFFLE is enabled

Chad Versace chad.versace at linux.intel.com
Tue May 22 18:01:57 PDT 2012


For GL tests (those built by CMakeLists.gl.txt), if USE_WAFFLE is enabled
then freeglut is replaced with glut_waffle.

For GLES1 and GLES2 tests, glut_waffle is now required.

Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 cmake/target_api/CMakeLists.txt       |   11 +++++------
 cmake/target_api/gl/CMakeLists.txt    |   20 +++++++++++++-------
 cmake/target_api/gles1/CMakeLists.txt |    2 +-
 cmake/target_api/gles2/CMakeLists.txt |    2 +-
 4 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/cmake/target_api/CMakeLists.txt b/cmake/target_api/CMakeLists.txt
index 57b28c7..f152ba2 100644
--- a/cmake/target_api/CMakeLists.txt
+++ b/cmake/target_api/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2010 Intel Corporation
+# Copyright (c) 2010-2012 Intel Corporation
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -18,9 +18,10 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
-#
-# Authors:
-#     Chad Versace <chad.versace at intel.com>
+
+# The no_api directory must precede the GL directories because it builds
+# glut_waffle, which the GL targets depend on.
+add_subdirectory(no_api)
 
 add_subdirectory(gl)
 
@@ -31,5 +32,3 @@ endif(BUILD_GLES1_TESTS)
 if(BUILD_GLES2_TESTS)
 	add_subdirectory(gles2)
 endif(BUILD_GLES2_TESTS)
-
-add_subdirectory(no_api)
diff --git a/cmake/target_api/gl/CMakeLists.txt b/cmake/target_api/gl/CMakeLists.txt
index 47adb91..ae67020 100644
--- a/cmake/target_api/gl/CMakeLists.txt
+++ b/cmake/target_api/gl/CMakeLists.txt
@@ -1,14 +1,20 @@
 set(piglit_target_api "gl")
 add_definitions(
 	-DUSE_OPENGL
-	-DUSE_GLUT
-	)
-include_directories(
-	${GLUT_INCLUDE_DIR}
-	)
-link_libraries(
-	${GLUT_glut_LIBRARY}
 	)
+
+if(USE_WAFFLE)
+	link_libraries(glut_waffle)
+else(USE_WAFFLE)
+	add_definitions(-DUSE_GLUT)
+	include_directories(
+		${GLUT_INCLUDE_DIR}
+		)
+	link_libraries(
+		${GLUT_glut_LIBRARY}
+		)
+endif(USE_WAFFLE)
+
 add_subdirectory(${piglit_SOURCE_DIR}/tests
 	${piglit_BINARY_DIR}/target_api/${piglit_target_api}/tests
 	)
diff --git a/cmake/target_api/gles1/CMakeLists.txt b/cmake/target_api/gles1/CMakeLists.txt
index bbd7fa8..02ca906 100644
--- a/cmake/target_api/gles1/CMakeLists.txt
+++ b/cmake/target_api/gles1/CMakeLists.txt
@@ -2,8 +2,8 @@ set(piglit_target_api "gles1")
 
 add_definitions(
 	-DUSE_OPENGL_ES1
-	-DUSE_EGLUT
 	)
+link_libraries(glut_waffle)
 add_subdirectory(${piglit_SOURCE_DIR}/tests
 	${piglit_BINARY_DIR}/target_api/${piglit_target_api}/tests
 	)
diff --git a/cmake/target_api/gles2/CMakeLists.txt b/cmake/target_api/gles2/CMakeLists.txt
index 378e074..4dcfd17 100644
--- a/cmake/target_api/gles2/CMakeLists.txt
+++ b/cmake/target_api/gles2/CMakeLists.txt
@@ -2,8 +2,8 @@ set(piglit_target_api "gles2")
 
 add_definitions(
 	-DUSE_OPENGL_ES2
-	-DUSE_EGLUT
 	)
+link_libraries(glut_waffle)
 add_subdirectory(${piglit_SOURCE_DIR}/tests
 	${piglit_BINARY_DIR}/target_api/${piglit_target_api}/tests
 	)
-- 
1.7.10.1



More information about the Piglit mailing list