glx-multithread-texture: Avoid front-buffer rendering.
[piglit.git] / tests / util / CMakeLists.txt
blobb7ea73bf3057a1f824526f70072926c5cd36928d
1 add_definitions(-DSOURCE_DIR="${piglit_SOURCE_DIR}/")
3 if(PIGLIT_HAS_POSIX_CLOCK_MONOTONIC AND HAVE_LIBRT)
4     link_libraries(rt)
5 endif()
7 # CMake requires that source file properties be set in the same directory where
8 # the property is used.
9 set_source_files_properties(
10         ${piglit_dispatch_gen_outputs}
11         PROPERTIES GENERATED 1
12         )
14 link_libraries(${CMAKE_DL_LIBS})
16 if(HAVE_LIBCACA)
17     link_libraries(caca)
18 endif()
20 if(HAVE_XKBCOMMON)
21         link_libraries(${XKBCOMMON_LIBRARIES})
22         include_directories(${XKBCOMMON_INCLUDE_DIRS})
23 endif()
25 if(PNG_FOUND)
26         link_libraries(${PNG_LIBRARIES})
27         include_directories(${PNG_INCLUDE_DIRS})
28 endif(PNG_FOUND)
30 set(UTIL_INCLUDES
31         ${CMAKE_CURRENT_BINARY_DIR}
32         ${CMAKE_CURRENT_SOURCE_DIR}
33         )
35 set(UTIL_SOURCES
36         piglit-log.c
37         piglit-util.c
38         piglit-subprocess.c
39         )
41 set(UTIL_GL_INCLUDES
42         ${UTIL_INCLUDES}
43         ${GLEXT_INCLUDE_DIR}
44         ${OPENGL_INCLUDE_PATH}
45         ${Waffle_INCLUDE_DIRS}
46         )
48 set(UTIL_GL_SOURCES
49         fdo-bitmap.c
50         minmax-test.c
51         piglit-dispatch.c
52         piglit-dispatch-init.c
53         piglit-fbo.cpp
54         piglit-matrix.c
55         piglit-test-pattern.cpp
56         piglit-util-gl.c
57         piglit-util-png.c
58         piglit-vbo.cpp
59         piglit-framework-gl.c
60         piglit-framework-gl/piglit_gl_framework.c
61         piglit-shader.c
62         piglit-shader-test.c
63         piglit_ktx.c
64         rgb9e5.c
65         r11g11b10f.c
66         sized-internalformats.c
67         ${CMAKE_BINARY_DIR}/tests/util/piglit-util-gl-enum-gen.c
68         )
70 set(UTIL_GL_LIBS
71         piglitutil
72         )
74 if(PIGLIT_USE_WAFFLE)
75         list(APPEND UTIL_GL_SOURCES
76                 piglit-framework-gl/piglit_fbo_framework.c
77                 piglit-framework-gl/piglit_wfl_framework.c
78                 piglit-framework-gl/piglit_winsys_framework.c
79                 piglit-framework-gl/piglit_sl_framework.c
80                 piglit-util-waffle.c
81         )
83         if(PIGLIT_HAS_WGL)
84                 list(APPEND UTIL_GL_SOURCES
85                         piglit-framework-gl/piglit_wgl_framework.c
86                 )
87         endif()
88         if(PIGLIT_HAS_GBM)
89                 list(APPEND UTIL_GL_SOURCES
90                         piglit-framework-gl/piglit_gbm_framework.c
91                 )
92                 list(APPEND UTIL_GL_LIBS
93                         ${GBM_LDFLAGS}
94                 )
95         endif()
96         if(PIGLIT_HAS_WAYLAND)
97                 list(APPEND UTIL_GL_SOURCES
98                         piglit-framework-gl/piglit_wl_framework.c
99                 )
100                 list(APPEND UTIL_GL_INCLUDES
101                         ${WAYLAND_wayland-client_INCLUDEDIR}
102                 )
103         endif()
104         if(PIGLIT_HAS_X11)
105                 list(APPEND UTIL_GL_SOURCES
106                         piglit-framework-gl/piglit_x11_framework.c
107                 )
108         endif()
110         list(APPEND UTIL_GL_LIBS
111                 ${Waffle_LDFLAGS}
112         )
113         IF(PIGLIT_BUILD_GLX_TESTS)
114                 list(APPEND UTIL_GL_LIBS
115                         ${OPENGL_gl_LIBRARY}
116                 )
117         ENDIF(PIGLIT_BUILD_GLX_TESTS)
118 else()
119         list(APPEND UTIL_GL_SOURCES
120                 piglit-framework-gl/piglit_glut_framework.c
121         )
123         list(APPEND UTIL_GL_LIBS
124                 ${OPENGL_gl_LIBRARY}
125         )
126 endif()
128 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
129         # One needs to have at least one hardware driver present, otherwise
130         # there is no point compiling just the dispatcher.
131         if(PIGLIT_BUILD_DMA_BUF_TESTS)
132                 add_definitions(-DHAVE_LIBDRM)
134                 list(APPEND UTIL_GL_SOURCES
135                         piglit-framework-gl/piglit_drm_dma_buf.c
136                 )
138                 list(APPEND UTIL_GL_LIBS
139                         ${LIBDRM_LDFLAGS}
140                         ${XCB_LDFLAGS}
141                         ${XCB_DRI2_LDFLAGS}
142                 )
144                 list(APPEND UTIL_GL_INCLUDES
145                         ${LIBDRM_INCLUDE_DIRS}
146                         ${XCB_INCLUDE_DIRS}
147                         ${XCB_DRI2_INCLUDE_DIRS}
148                 )
149         endif()
151         if(PIGLIT_HAS_X11)
152                 list(APPEND UTIL_GL_LIBS ${X11_X11_LIB})
153         endif()
155         if(PIGLIT_HAS_WAYLAND)
156                 list(APPEND UTIL_GL_LIBS ${WAYLAND_LDFLAGS})
157         endif()
159 endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
161 if(MSVC)
162         list(APPEND UTIL_SOURCES msvc/getopt.c)
163 endif()
165 piglit_include_target_api()