[Piglit] [PATCH 1/4] cmake: add an option for building GLX tests

nobled nobled at dreamwidth.org
Sun Apr 22 01:42:51 PDT 2012


---
 CMakeLists.txt                                     |    5 +++++
 tests/glx/CMakeLists.gl.txt                        |    4 ++--
 .../spec/glx_arb_create_context/CMakeLists.gl.txt  |    4 ++--
 .../spec/glx_ext_import_context/CMakeLists.gl.txt  |    4 ++--
 tests/util/CMakeLists.gl.txt                       |    4 ++--
 5 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 581a813..d2e38ab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,11 @@ find_package(PNG REQUIRED)
 find_package(X11)

 IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+	option(BUILD_GLX_TESTS "Build tests that require GLX" ON)
+ELSE()
+	option(BUILD_GLX_TESTS "Build tests that require GLX" OFF)
+ENDIF()
+IF(BUILD_GLX_TESTS)
 	pkg_check_modules(GLPROTO REQUIRED glproto)
 ENDIF()

diff --git a/tests/glx/CMakeLists.gl.txt b/tests/glx/CMakeLists.gl.txt
index 8d83a87..61dd9c9 100644
--- a/tests/glx/CMakeLists.gl.txt
+++ b/tests/glx/CMakeLists.gl.txt
@@ -13,7 +13,7 @@ link_libraries (
 	${X11_X11_LIB}
 )

-IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+IF(BUILD_GLX_TESTS)
 	include_directories(
 		${GLPROTO_INCLUDE_DIRS}
 	)
@@ -60,6 +60,6 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")

 	piglit_add_executable (glx-copy-sub-buffer glx-copy-sub-buffer.c)
 	piglit_add_executable (glx-query-drawable glx-query-drawable.c)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ENDIF(BUILD_GLX_TESTS)

 # vim: ft=cmake:
diff --git a/tests/spec/glx_arb_create_context/CMakeLists.gl.txt
b/tests/spec/glx_arb_create_context/CMakeLists.gl.txt
index a3d58a2..585dbd6 100644
--- a/tests/spec/glx_arb_create_context/CMakeLists.gl.txt
+++ b/tests/spec/glx_arb_create_context/CMakeLists.gl.txt
@@ -13,7 +13,7 @@ link_libraries (
 	${X11_X11_LIB}
 )

-IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+IF(BUILD_GLX_TESTS)
 	include_directories(
 		${GLPROTO_INCLUDE_DIRS}
 	)
@@ -28,6 +28,6 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 	piglit_add_executable (glx-create-context-valid-attribute-empty
valid-attribute-empty.c common.c)
 	piglit_add_executable (glx-create-context-valid-attribute-null
valid-attribute-null.c common.c)
 	piglit_add_executable
(glx-create-context-valid-flag-forward-compatible
valid-flag-forward-compatible.c common.c)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ENDIF(BUILD_GLX_TESTS)

 # vim: ft=cmake:
diff --git a/tests/spec/glx_ext_import_context/CMakeLists.gl.txt
b/tests/spec/glx_ext_import_context/CMakeLists.gl.txt
index 7df4cd9..425b1f7 100644
--- a/tests/spec/glx_ext_import_context/CMakeLists.gl.txt
+++ b/tests/spec/glx_ext_import_context/CMakeLists.gl.txt
@@ -13,7 +13,7 @@ link_libraries (
 	${X11_X11_LIB}
 )

-IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+IF(BUILD_GLX_TESTS)
 	include_directories(
 		${GLPROTO_INCLUDE_DIRS}
 	)
@@ -26,6 +26,6 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 	piglit_add_executable (glx-make-current-multi-process
make-current-multi-process.c common.c)
 	piglit_add_executable (glx-make-current-single-process
make-current-single-process.c common.c)
 	piglit_add_executable (glx-query-context-info-ext
query-context-info.c common.c)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ENDIF(BUILD_GLX_TESTS)

 # vim: ft=cmake:
diff --git a/tests/util/CMakeLists.gl.txt b/tests/util/CMakeLists.gl.txt
index 1052c26..7790e4f 100644
--- a/tests/util/CMakeLists.gl.txt
+++ b/tests/util/CMakeLists.gl.txt
@@ -16,7 +16,7 @@ set(UTIL_SOURCES
 	sized-internalformats.c
 	)

-IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+IF(BUILD_GLX_TESTS)
 	# XXX: This is currently duplicated wherever tests
 	# include "piglit-glx-util.h". Is it possible to refactor it?
 	include_directories(
@@ -40,7 +40,7 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 		${UTIL_SOURCES}
 		piglit-glx-util.c
 	)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ENDIF(BUILD_GLX_TESTS)

 piglit_add_library (piglitutil
 	${UTIL_SOURCES}
-- 
1.7.4.1


More information about the Piglit mailing list