
include_directories(
	${GLEXT_INCLUDE_DIR}
	${OPENGL_INCLUDE_PATH}
)

if(PIGLIT_BUILD_GLX_TESTS)
	link_libraries (
		piglitglxutil
	)
endif(PIGLIT_BUILD_GLX_TESTS)

link_libraries (
	${OPENGL_gl_LIBRARY}
	${CMAKE_THREAD_LIBS_INIT}
)

IF(PIGLIT_BUILD_GLX_TESTS)
	include_directories(
		${GLPROTO_INCLUDE_DIRS}
	)
	link_libraries (
		${X11_X11_LIB}
	)
	piglit_add_executable (glx-fbconfig-sanity glx-fbconfig-sanity.c)
	piglit_add_executable (glx-fbconfig-compliance glx-fbconfig-compliance.c)
	piglit_add_executable (glx-fbconfig-bad glx-fbconfig-bad.c)
	piglit_add_executable (glx-fbo-binding glx-fbo-binding.c)
	piglit_add_executable (glx-shader-sharing glx-shader-sharing.c)
	piglit_add_executable (glx-close-display glx-close-display.c)
	piglit_add_executable (glx-destroycontext-1 glx-destroycontext-1.c)
	piglit_add_executable (glx-destroycontext-2 glx-destroycontext-2.c)
	piglit_add_executable (glx-destroycontext-3 glx-destroycontext-3.c)
	piglit_add_executable (glx-dont-care-mask glx-dont-care-mask.c)
	piglit_add_executable (glx-multi-context-front glx-multi-context-front.c)
	piglit_add_executable (glx-multi-context-ib-1 glx-multi-context-ib-1.c)
	piglit_add_executable (glx-multi-context-single-window glx-multi-context-single-window.c)
	piglit_add_executable (glx-multi-window-single-context glx-multi-window-single-context.c)
	piglit_add_executable (glx-multithread glx-multithread.c)
	target_link_libraries(glx-multithread pthread)
	piglit_add_executable (glx-context-flush-control glx-context-flush-control.c)
	target_link_libraries (glx-context-flush-control pthread)
	piglit_add_executable (glx-multithread-buffer glx-multithread-buffer.c)
	piglit_add_executable (glx-multithread-buffer-refcount-bug glx-multithread-buffer-refcount-bug.c)
	piglit_add_executable (glx-multithread-clearbuffer glx-multithread-clearbuffer.c)
	target_link_libraries(glx-multithread-clearbuffer pthread)
	piglit_add_executable (glx-multithread-texture glx-multithread-texture.c)
	target_link_libraries(glx-multithread-texture pthread)
	piglit_add_executable (glx-multithread-makecurrent-1 glx-multithread-makecurrent-1.c)
	target_link_libraries(glx-multithread-makecurrent-1 pthread)
	piglit_add_executable (glx-multithread-makecurrent-2 glx-multithread-makecurrent-2.c)
	target_link_libraries(glx-multithread-makecurrent-2 pthread)
	piglit_add_executable (glx-multithread-makecurrent-3 glx-multithread-makecurrent-3.c)
	target_link_libraries(glx-multithread-makecurrent-3 pthread)
	piglit_add_executable (glx-multithread-makecurrent-4 glx-multithread-makecurrent-4.c)
	target_link_libraries(glx-multithread-makecurrent-4 pthread)
	piglit_add_executable (glx-multithread-shader-compile glx-multithread-shader-compile.c)
	target_link_libraries(glx-multithread-shader-compile pthread)
	piglit_add_executable (glx-make-current glx-make-current.c)
	piglit_add_executable (glx-make-current-other-thread glx-make-current-other-thread.c)
	piglit_add_executable (glx-copy-context-dest-current glx-copy-context-dest-current.c)
	piglit_add_executable (glx-swap-event glx-swap-event.c)
	piglit_add_executable (glx-make-glxdrawable-current glx-make-glxdrawable-current.c)
	piglit_add_executable (glx-swap-exchange glx-swap-exchange.c)
	piglit_add_executable (glx-swap-copy glx-swap-copy.c)
	piglit_add_executable (glx-swap-pixmap glx-swap-pixmap.c)
	piglit_add_executable (glx-swap-pixmap-bad glx-swap-pixmap-bad.c)
	piglit_add_executable (glx-swap-singlebuffer glx-swap-singlebuffer.c)
	piglit_add_executable (glx-swap-pbuffer glx-swap-pbuffer.c)
	piglit_add_executable (glx-multi-display-single-pbuffer glx-multi-display-single-pbuffer.c)

	if (X11_Xrender_FOUND)
		include_directories(${X11_Xrender_INCLUDE_PATH})
		piglit_add_executable (glx-tfp glx-tfp.c)
		target_link_libraries(glx-tfp ${X11_Xrender_LIB})
	endif()

	piglit_add_executable (glx-pixmap-life glx-pixmap-life.c)
	piglit_add_executable (glx-pixmap13-life glx-pixmap13-life.c)
	piglit_add_executable (glx-window-life glx-window-life.c)
	piglit_add_executable (glx-pixmap-multi glx-pixmap-multi.c)
	piglit_add_executable (glx-pixmap-crosscheck glx-pixmap-crosscheck.c)

	piglit_add_executable (glx-visuals-depth glx-visuals-depth.c)
	piglit_add_executable (glx-visuals-stencil glx-visuals-stencil.c)

	piglit_add_executable (glx-copy-sub-buffer glx-copy-sub-buffer.c)
	piglit_add_executable (glx-query-drawable glx-query-drawable.c)
	piglit_add_executable (glx-buffer-age glx-buffer-age.c)

	piglit_add_executable (glx-string-sanity glx-string-sanity.c)
	if(${PIGLIT_BUILD_GLES1_TESTS} OR ${PIGLIT_BUILD_GLES2_TESTS} OR ${PIGLIT_BUILD_GLES3_TESTS})
		piglit_add_executable (glx-egl-switch-context glx-egl-switch-context.c)
	endif()

ENDIF(PIGLIT_BUILD_GLX_TESTS)

# vim: ft=cmake:
