[Piglit] [PATCHv2 10/10] cmake: add gles1 as a valid target API
Chia-I Wu
olvaffe at gmail.com
Sun Sep 4 19:45:01 PDT 2011
This commit adds the infrastructure for writing GLES1 specific tests.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
CMakeLists.txt | 1 +
cmake/target_api/CMakeLists.txt | 3 ++-
cmake/target_api/gles1/CMakeLists.txt | 11 +++++++++++
tests/CMakeLists.txt | 1 +
tests/gles1/CMakeLists.gles1.txt | 15 +++++++++++++++
tests/gles1/CMakeLists.txt | 1 +
tests/util/CMakeLists.gl.txt | 1 +
tests/util/CMakeLists.gles1.txt | 20 ++++++++++++++++++++
tests/util/CMakeLists.gles2.txt | 1 +
tests/util/CMakeLists.txt | 1 -
10 files changed, 53 insertions(+), 2 deletions(-)
create mode 100644 cmake/target_api/gles1/CMakeLists.txt
create mode 100644 tests/gles1/CMakeLists.gles1.txt
create mode 100644 tests/gles1/CMakeLists.txt
create mode 100644 tests/util/CMakeLists.gles1.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3f21f2..ae2ca08 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,6 +84,7 @@ FIND_LIBRARY(OPENGL_egl_LIBRARY
NAMES EGL
PATHS /usr/lib
)
+find_library(OPENGL_gles1_LIBRARY NAMES GLESv1_CM)
find_library(OPENGL_gles2_LIBRARY NAMES GLESv2)
# Put all executables into the bin subdirectory
diff --git a/cmake/target_api/CMakeLists.txt b/cmake/target_api/CMakeLists.txt
index ea9adf5..eecbd35 100644
--- a/cmake/target_api/CMakeLists.txt
+++ b/cmake/target_api/CMakeLists.txt
@@ -30,7 +30,7 @@
#
function(piglit_include_target_api)
set(valid_api FALSE)
- foreach(api "gl" "gles2" "no_api")
+ foreach(api "gl" "gles1" "gles2" "no_api")
if(piglit_target_api STREQUAL ${api})
set(valid_api TRUE)
break()
@@ -46,5 +46,6 @@ function(piglit_include_target_api)
endfunction(piglit_include_target_api)
add_subdirectory(gl)
+add_subdirectory(gles1)
add_subdirectory(gles2)
add_subdirectory(no_api)
diff --git a/cmake/target_api/gles1/CMakeLists.txt b/cmake/target_api/gles1/CMakeLists.txt
new file mode 100644
index 0000000..ed50d1c
--- /dev/null
+++ b/cmake/target_api/gles1/CMakeLists.txt
@@ -0,0 +1,11 @@
+set(piglit_target_api "gles1")
+
+if(OPENGL_gles1_LIBRARY AND OPENGL_egl_LIBRARY)
+ add_definitions(
+ -DUSE_OPENGL_ES1
+ -DUSE_EGLUT
+ )
+ add_subdirectory(${piglit_SOURCE_DIR}/tests
+ ${piglit_BINARY_DIR}/target_api/${piglit_target_api}/tests
+ )
+endif(OPENGL_gles1_LIBRARY AND OPENGL_egl_LIBRARY)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 52d16d4..7a5b8c4 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -2,6 +2,7 @@ add_subdirectory (util)
add_subdirectory (bugs)
add_subdirectory (fbo)
add_subdirectory (general)
+add_subdirectory (gles1)
add_subdirectory (gles2)
add_subdirectory (glx)
add_subdirectory (glslparsertest)
diff --git a/tests/gles1/CMakeLists.gles1.txt b/tests/gles1/CMakeLists.gles1.txt
new file mode 100644
index 0000000..e78b487
--- /dev/null
+++ b/tests/gles1/CMakeLists.gles1.txt
@@ -0,0 +1,15 @@
+#add_definitions(-DSOURCE_DIR="${piglit_SOURCE_DIR}/")
+
+include_directories(
+ ${OPENGL_INCLUDE_PATH}
+ ${piglit_SOURCE_DIR}/tests/util/
+ )
+
+link_libraries(
+ ${OPENGL_gles1_LIBRARY}
+ ${OPENGL_egl_LIBRARY}
+ glut_egl
+ piglitutil_gles1
+ )
+
+# vim: ft=cmake:
diff --git a/tests/gles1/CMakeLists.txt b/tests/gles1/CMakeLists.txt
new file mode 100644
index 0000000..144a306
--- /dev/null
+++ b/tests/gles1/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/util/CMakeLists.gl.txt b/tests/util/CMakeLists.gl.txt
index 5b52776..a03b50b 100644
--- a/tests/util/CMakeLists.gl.txt
+++ b/tests/util/CMakeLists.gl.txt
@@ -7,6 +7,7 @@ include_directories(
set(UTIL_SOURCES
${UTIL_SOURCES}
glew.c
+ piglit-shader.c
piglit-shader-gl.c
piglit-util-gl.c
)
diff --git a/tests/util/CMakeLists.gles1.txt b/tests/util/CMakeLists.gles1.txt
new file mode 100644
index 0000000..e4bbb33
--- /dev/null
+++ b/tests/util/CMakeLists.gles1.txt
@@ -0,0 +1,20 @@
+set(UTIL_SOURCES
+ ${UTIL_SOURCES}
+ piglit-util-gles.c
+ )
+
+link_libraries(
+ ${OPENGL_gles1_LIBRARY}
+ piglitutil_${piglit_target_api}
+ glut_egl
+ )
+
+add_library(piglitutil_${piglit_target_api}
+ ${UTIL_SOURCES}
+)
+
+if(UNIX)
+ target_link_libraries(piglitutil_${piglit_target_api} m)
+endif(UNIX)
+
+# vim: ft=cmake:
diff --git a/tests/util/CMakeLists.gles2.txt b/tests/util/CMakeLists.gles2.txt
index e3de35f..65d55a6 100644
--- a/tests/util/CMakeLists.gles2.txt
+++ b/tests/util/CMakeLists.gles2.txt
@@ -1,5 +1,6 @@
set(UTIL_SOURCES
${UTIL_SOURCES}
+ piglit-shader.c
piglit-shader-gles2.c
piglit-util-gles.c
)
diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
index 5da4cd9..3daccea 100644
--- a/tests/util/CMakeLists.txt
+++ b/tests/util/CMakeLists.txt
@@ -12,7 +12,6 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(UTIL_SOURCES
fdo-bitmap.c
piglit-util.c
- piglit-shader.c
shader-load.c
piglit-framework.c
rgb9e5.c
--
1.7.5.4
More information about the Piglit
mailing list