1 cmake_minimum_required(VERSION 3.2)
3 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
5 INCLUDE (GNUInstallDirs)
6 INCLUDE (CheckCCompilerFlag)
7 INCLUDE (CheckCSourceCompiles)
8 INCLUDE (CheckCXXCompilerFlag)
9 INCLUDE (CheckFunctionExists)
10 INCLUDE (CheckIncludeFile)
11 INCLUDE (FindPkgConfig)
13 # http://www.cmake.org/cmake/help/v3.0/policy/CMP0042.html
15 cmake_policy (SET CMP0042 NEW)
19 cmake_policy (SET CMP0072 OLD)
26 message (FATAL_ERROR "Windows builds require MinGW")
32 add_definitions(-DPIGLIT_HAS_PNG)
36 set(PIGLIT_HAS_X11 True)
37 add_definitions(-DPIGLIT_HAS_X11)
40 if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
41 set(PIGLIT_BUILD_GLES_TESTS_DEFAULT ON)
43 set(PIGLIT_BUILD_GLES_TESTS_DEFAULT OFF)
46 option(PIGLIT_BUILD_GL_TESTS "Build tests for OpenGL" ON)
47 option(PIGLIT_BUILD_GLES1_TESTS "Build tests for OpenGL ES1" ${PIGLIT_BUILD_GLES_TESTS_DEFAULT})
48 option(PIGLIT_BUILD_GLES2_TESTS "Build tests for OpenGL ES2" ${PIGLIT_BUILD_GLES_TESTS_DEFAULT})
49 option(PIGLIT_BUILD_GLES3_TESTS "Build tests for OpenGL ES3" ${PIGLIT_BUILD_GLES_TESTS_DEFAULT})
50 option(PIGLIT_BUILD_CL_TESTS "Build tests for OpenCL" OFF)
52 if(PIGLIT_BUILD_GL_TESTS)
53 find_package(OpenGL REQUIRED)
56 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
57 option(PIGLIT_USE_WAFFLE "Use Waffle in place of GLUT" ON)
59 option(PIGLIT_USE_WAFFLE "Use Waffle in place of GLUT" OFF)
64 pkg_check_modules(Waffle REQUIRED waffle-1)
67 message(FATAL_ERROR "Failed to find Waffle. If Waffle "
68 "is not packaged for your distribution, you can get "
69 "it at http://www.waffle-gl.org."
73 # Check the installed waffle version.
75 # We cannot reliably check the version with pkg_check_modules(), but
76 # instead must check the version manually as below. The problem is that,
77 # if one passes a required version to pkg_check_modules(), CMake
78 # validates the required version at most once for the lifetime of the
79 # source tree. If someone changes the required version by editing the
80 # CMakeLists, CMake fails to detect the new requirement.
81 set(Waffle_REQUIRED_VERSION "1.5.0")
82 if(Waffle_VERSION VERSION_LESS Waffle_REQUIRED_VERSION)
83 message(FATAL_ERROR "Found waffle-${Waffle_VERSION}, but "
84 "piglit requires waffle-${Waffle_REQUIRED_VERSION}")
87 find_path(Waffle_INCLUDE_DIRS waffle.h)
88 find_library(Waffle_LDFLAGS waffle-1)
89 if(Waffle_INCLUDE_DIRS AND Waffle_LDFLAGS)
90 set(Waffle_FOUND TRUE)
92 message(FATAL_ERROR "Failed to find Waffle. Get and build Waffle from "
93 "http://www.waffle-gl.org and set Waffle_INCLUDE_DIRS and "
94 "Waffle_LDFLAGS variables accordingly."
99 add_definitions(-DPIGLIT_USE_WAFFLE)
100 add_definitions(-DWAFFLE_API_VERSION=0x0103)
102 find_package(GLUT REQUIRED)
104 # The 'REQUIRED' above correctly produces an error for
105 # OpenGL, but there's a bug involving FindGLUT.cmake
106 # that fails to produce the error as of CMake 2.8.5.
108 # Instead, CMake keeps going and eventually spams
109 # the console with a message for every target that used
110 # e.g. the ${GLUT_INCLUDE_DIR} variable. So it
111 # prints a line for basically every single test in piglit.
113 # Work around the bug and error out quickly here instead.
115 message(FATAL_ERROR "GLUT library not found")
117 endif(PIGLIT_USE_WAFFLE)
119 if(PIGLIT_BUILD_GLES1_TESTS AND NOT PIGLIT_USE_WAFFLE)
120 message(FATAL_ERROR "Option PIGLIT_BUILD_GLES1_TESTS requires PIGLIT_USE_WAFFLE")
121 endif(PIGLIT_BUILD_GLES1_TESTS AND NOT PIGLIT_USE_WAFFLE)
123 if(PIGLIT_BUILD_GLES2_TESTS AND NOT PIGLIT_USE_WAFFLE)
124 message(FATAL_ERROR "Option PIGLIT_BUILD_GLES2_TESTS requires PIGLIT_USE_WAFFLE")
125 endif(PIGLIT_BUILD_GLES2_TESTS AND NOT PIGLIT_USE_WAFFLE)
127 if(PIGLIT_BUILD_GLES3_TESTS AND NOT PIGLIT_USE_WAFFLE)
128 message(FATAL_ERROR "Option PIGLIT_BUILD_GLES3_TESTS requires PIGLIT_USE_WAFFLE")
129 endif(PIGLIT_BUILD_GLES3_TESTS AND NOT PIGLIT_USE_WAFFLE)
131 if(PIGLIT_BUILD_CL_TESTS)
132 find_package(OpenCL REQUIRED)
133 endif(PIGLIT_BUILD_CL_TESTS)
135 IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
136 if(X11_FOUND AND OPENGL_gl_LIBRARY)
137 # Assume the system has GLX. In the future, systems may exist
138 # with libGL and libX11 but no GLX, but that world hasn't
140 set(PIGLIT_HAS_GLX True)
141 add_definitions(-DPIGLIT_HAS_GLX)
144 pkg_check_modules(GBM QUIET gbm>=17.1)
146 set(PIGLIT_HAS_GBM True)
147 add_definitions(-DPIGLIT_HAS_GBM)
148 set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${GBM_LIBRARIES})
149 CHECK_FUNCTION_EXISTS(gbm_bo_map PIGLIT_HAS_GBM_BO_MAP)
150 if (PIGLIT_HAS_GBM_BO_MAP)
151 add_definitions(-DPIGLIT_HAS_GBM_BO_MAP)
155 pkg_check_modules(WAYLAND QUIET wayland-client)
157 set(PIGLIT_HAS_WAYLAND True)
158 add_definitions(-DPIGLIT_HAS_WAYLAND)
160 FIND_LIBRARY(HAVE_XKBCOMMON NAMES xkbcommon)
161 if(NOT HAVE_XKBCOMMON)
162 message(FATAL_ERROR "Wayland support requires xkbcommon. "
163 "Failed to find xkbcommon library.")
165 pkg_check_modules(XKBCOMMON QUIET xkbcommon)
168 pkg_check_modules(LIBDRM QUIET libdrm)
169 pkg_check_modules(LIBDRM_INTEL QUIET libdrm_intel)
170 pkg_check_modules(XCB QUIET xcb)
171 pkg_check_modules(XCB_DRI2 QUIET xcb-dri2)
172 pkg_check_modules(GLPROTO QUIET glproto)
173 ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
174 if (PIGLIT_USE_WAFFLE)
175 set(PIGLIT_HAS_WGL True)
176 add_definitions(-DPIGLIT_HAS_WGL)
181 option(PIGLIT_BUILD_GLX_TESTS "Build tests that require GLX" ON)
183 option(PIGLIT_BUILD_GLX_TESTS "Build tests that require GLX" OFF)
187 option(PIGLIT_BUILD_WGL_TESTS "Build tests that require WGL" ON)
189 option(PIGLIT_BUILD_WGL_TESTS "Build tests that require WGL" OFF)
193 # Choose to build tests that use dma_buf.
195 # Piglit's dma_buf utilities require xcb-dri2 to gain DRM authentication.
197 # The presence of libdrm is not sufficient. At least one libdrm_${hardware}
198 # library is also needed.
200 # When building for Intel, libdrm_intel>=2.4.38 is required because support for
201 # drm-prime arrived in that version.
203 if(LIBDRM_FOUND AND XCB_DRI2_FOUND AND
204 ((LIBDRM_INTEL_VERSION VERSION_GREATER "2.4.37") OR
205 PIGLIT_HAS_GBM_BO_MAP))
206 set(PIGLIT_BUILD_DMA_BUF_TESTS_IS_VALID true)
208 set(PIGLIT_BUILD_DMA_BUF_TESTS_IS_VALID false)
211 if(PIGLIT_BUILD_DMA_BUF_TESTS_IS_VALID)
212 option(PIGLIT_BUILD_DMA_BUF_TESTS "Build tests that use dma_buf" ON)
214 option(PIGLIT_BUILD_DMA_BUF_TESTS "Build tests that use dma_buf" OFF)
217 # If the users has updated PIGLIT_BUILD_DMA_BUF_TESTS in the CMakeCache, then
218 # we need to validate it.
219 if(PIGLIT_BUILD_DMA_BUF_TESTS AND NOT PIGLIT_BUILD_DMA_BUF_TESTS_IS_VALID)
221 "PIGLIT_BUILD_DMA_BUF_TESTS require libdrm, "
222 "libdrm_intel>=2.4.38, and xcb-dri2")
225 IF(PIGLIT_BUILD_GLX_TESTS)
226 pkg_check_modules(GLPROTO REQUIRED glproto)
229 set(Python_ADDITIONAL_VERSIONS
231 find_package(PythonInterp REQUIRED)
232 find_package(PythonSix 1.5.2 REQUIRED)
233 find_package(PythonNumpy 1.7.0 REQUIRED)
235 # CMake doesn't have a VERSION_GREATER_EQUAL function, at least as of 3.0,
236 # And mako 1.0.2 contains bug fixes required for python 3.5 to work, so
237 # the only solution (short of having a series of "OR" statements, is this)
238 if (PYTHON_VERSION_STRING VERSION_GREATER 3.4.999999)
239 find_package(PythonMako 1.0.2 REQUIRED)
241 find_package(PythonMako 0.8.0 REQUIRED)
242 endif (PYTHON_VERSION_STRING VERSION_GREATER 3.4.999999)
244 find_package(bash-completion NO_MODULE)
246 # Default to compiling with debug information (`gcc -g`):
247 if(NOT CMAKE_BUILD_TYPE)
248 SET(CMAKE_BUILD_TYPE Debug CACHE STRING
249 "May be one of: None Debug RelWithDebInfo Release MinSizeRel" FORCE)
250 endif(NOT CMAKE_BUILD_TYPE)
253 CHECK_C_COMPILER_FLAG("-Wall" C_COMPILER_FLAG_WALL)
254 IF (C_COMPILER_FLAG_WALL)
255 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
256 ENDIF (C_COMPILER_FLAG_WALL)
257 CHECK_CXX_COMPILER_FLAG("-Wall" CXX_COMPILER_FLAG_WALL)
258 IF (CXX_COMPILER_FLAG_WALL)
259 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
260 ENDIF (CXX_COMPILER_FLAG_WALL)
262 # Target C99. GCC's default is gnu11 for 5.0 and newer, gnu89 for
264 check_c_compiler_flag ("-std=gnu99" C_COMPILER_FLAG_STD_GNU99)
265 if (C_COMPILER_FLAG_STD_GNU99)
266 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
268 # MSVC does not support C99 variable length arrays
269 CHECK_C_COMPILER_FLAG("-Werror=vla" C_COMPILER_FLAG_WEVLA)
270 IF (C_COMPILER_FLAG_WEVLA)
271 SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=vla")
273 # GCC allows void pointer arithmetic, but it is not part of ISO C and
274 # in particular MSVC will throw `C2036: 'void *' : unknown size`
275 check_c_compiler_flag ("-Werror=pointer-arith" C_COMPILER_FLAG_WEPOINTER_ARITH)
276 if (C_COMPILER_FLAG_WEPOINTER_ARITH)
277 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=pointer-arith")
279 # MSVC only supports C99 variadic macros. It doesn't support the
280 # non-standard GNU named variadic macro syntax that's documented in
281 # https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html
283 # XXX: on older GCC version this option has no effect unless -Wpedantic
284 # is set, but this should be fixed on future GCC versions, per
285 # https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01459.html
286 check_c_compiler_flag ("-Werror=variadic-macros" C_COMPILER_FLAG_WVARIADIC_MACROS)
287 if (C_COMPILER_FLAG_WVARIADIC_MACROS)
288 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=variadic-macros")
291 CHECK_CXX_COMPILER_FLAG("-Wno-narrowing" CXX_COMPILER_FLAG_WNO_NARROWING)
292 IF (CXX_COMPILER_FLAG_WNO_NARROWING)
293 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing")
294 ENDIF (CXX_COMPILER_FLAG_WNO_NARROWING)
297 add_definitions (-W3)
298 add_definitions (-wd4018) # signed/unsigned mismatch
299 add_definitions (-wd4244) # conversion from 'type1' to 'type2', possible loss of data
300 add_definitions (-wd4305) # truncation from 'type1' to 'type2'
301 add_definitions (-wd4800) # forcing value to bool 'true' or 'false' (performance warning)
303 add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
304 add_definitions (-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
308 # Match MSVC default stack size
309 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,1048576")
311 # Avoid depending on MinGW runtime DLLs
312 check_cxx_compiler_flag (-static-libgcc HAVE_STATIC_LIBGCC_FLAG)
313 if (HAVE_STATIC_LIBGCC_FLAG)
314 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc")
315 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc")
316 set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -static-libgcc")
318 check_cxx_compiler_flag (-static-libstdc++ HAVE_STATIC_LIBSTDCXX_FLAG)
319 if (HAVE_STATIC_LIBSTDCXX_FLAG)
320 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
321 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++")
322 set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -static-libstdc++")
326 if (${CMAKE_C_COMPILER_ID} STREQUAL "SunPro")
327 # Use C++ to link C files.
328 # http://developers.sun.com/solaris/articles/mixing.html#linking
329 # Modified rule from Modules/CMakeCInformation.cmake.
330 set (CMAKE_C_LINK_EXECUTABLE
331 "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
334 # Always enable GNU C extensions. Non-GNU platforms will need to
335 # define wrappers for them.
336 add_definitions(-D_GNU_SOURCE)
339 # MSVC & MinGW only define & use APIENTRY
340 add_definitions (-DGLAPIENTRY=__stdcall)
342 # Avoid namespace pollution when including windows.h
343 # http://support.microsoft.com/kb/166474
344 add_definitions (-DWIN32_LEAN_AND_MEAN=1)
346 # Don't define min/max macros
347 add_definitions (-DNOMINMAX)
349 # Define M_PI and others
350 add_definitions (-D_USE_MATH_DEFINES)
354 # Don't warn about using deprecated OpenGL/GLUT functions.
355 # TODO: It would be nice to silence just the deprecation macros from
356 # OpenGLAvailability.h as opposed to all deprecated functions.
357 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
358 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
363 find_path(GLEXT_INCLUDE_DIR
365 PATHS ${OPENGL_INCLUDE_DIR}
366 DOC "Include for OpenGL/glext.h on OSX"
369 find_path(GLEXT_INCLUDE_DIR
371 PATHS ${OPENGL_INCLUDE_DIR}
372 DOC "Include for GL/glext.h"
377 if(CMAKE_USE_PTHREADS_INIT)
378 set(PIGLIT_HAS_PTHREADS true)
379 add_definitions(-DPIGLIT_HAS_PTHREADS)
382 FIND_LIBRARY(HAVE_LIBRT NAMES rt)
384 set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} rt)
387 check_c_source_compiles(
389 #define _POSIX_C_SOURCE 199309L
391 int main() { return clock_gettime(CLOCK_MONOTONIC, NULL); }
393 PIGLIT_HAS_POSIX_CLOCK_MONOTONIC
396 if(PIGLIT_HAS_PTHREADS AND PIGLIT_HAS_POSIX_CLOCK_MONOTONIC)
397 check_c_source_compiles(
401 static void timeout(union sigval val) { }
403 struct sigevent sev = {
404 .sigev_notify = SIGEV_THREAD,
405 .sigev_notify_function = timeout,
408 return timer_create(CLOCK_MONOTONIC, &sev, &timerid);
411 PIGLIT_HAS_POSIX_TIMER_NOTIFY_THREAD
415 set(CMAKE_REQUIRED_LIBRARIES)
417 if(PIGLIT_HAS_POSIX_CLOCK_MONOTONIC)
418 add_definitions(-DPIGLIT_HAS_POSIX_CLOCK_MONOTONIC)
421 if(PIGLIT_HAS_POSIX_TIMER_NOTIFY_THREAD)
422 add_definitions(-DPIGLIT_HAS_POSIX_TIMER_NOTIFY_THREAD)
426 FIND_LIBRARY(HAVE_LIBCACA NAMES caca)
428 set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} caca)
429 add_definitions(-DPIGLIT_HAS_LIBCACA)
433 if(PIGLIT_USE_WAFFLE AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
434 pkg_check_modules(EGL egl>=11.0)
438 add_definitions(-DPIGLIT_HAS_EGL)
439 include_directories(${EGL_INCLUDE_DIRS})
440 add_definitions (${EGL_CFLAGS_OTHER})
443 if(PIGLIT_BUILD_GLES1_TESTS AND NOT EGL_FOUND)
444 message(FATAL_ERROR "Option PIGLIT_BUILD_GLES1_TESTS requires EGL. "
445 "Failed to find EGL library.")
448 if(PIGLIT_BUILD_GLES2_TESTS AND NOT EGL_FOUND)
449 message(FATAL_ERROR "Option PIGLIT_BUILD_GLES2_TESTS requires EGL. "
450 "Failed to find EGL library.")
453 if(PIGLIT_BUILD_GLES3_TESTS AND NOT EGL_FOUND)
454 message(FATAL_ERROR "Option PIGLIT_BUILD_GLES3_TESTS requires EGL. "
455 "Failed to find EGL library.")
458 # Put all executables into the bin subdirectory
459 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${piglit_BINARY_DIR}/bin)
460 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${piglit_BINARY_DIR}/lib)
462 # Do the same for MSVC, regardless of the build type. This only works correctly
463 # for CMake 2.8.1 and above.
464 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${piglit_BINARY_DIR}/bin)
465 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${piglit_BINARY_DIR}/bin)
466 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${piglit_BINARY_DIR}/bin)
467 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${piglit_BINARY_DIR}/bin)
469 check_function_exists(asprintf HAVE_ASPRINTF)
470 check_function_exists(ffs HAVE_FFS)
471 check_function_exists(strchrnul HAVE_STRCHRNUL)
472 check_function_exists(strndup HAVE_STRNDUP)
474 check_function_exists(fopen_s HAVE_FOPEN_S)
476 check_function_exists(setrlimit HAVE_SETRLIMIT)
478 check_include_file(sys/time.h HAVE_SYS_TIME_H)
479 check_include_file(sys/types.h HAVE_SYS_TYPES_H)
480 check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H)
481 check_include_file(sys/stat.h HAVE_SYS_STAT_H)
482 check_include_file(unistd.h HAVE_UNISTD_H)
483 check_include_file(fcntl.h HAVE_FCNTL_H)
484 check_include_file(linux/sync_file.h HAVE_LINUX_SYNC_FILE_H)
486 if(DEFINED PIGLIT_INSTALL_VERSION)
487 set(PIGLIT_INSTALL_VERSION_SUFFIX
488 "-${PIGLIT_INSTALL_VERSION}")
490 set(PIGLIT_INSTALL_VERSION_SUFFIX "")
492 set(PIGLIT_INSTALL_LIBDIR
493 "${CMAKE_INSTALL_LIBDIR}/piglit${PIGLIT_INSTALL_VERSION_SUFFIX}")
494 if(NOT IS_ABSOLUTE ${PIGLIT_INSTALL_LIBDIR})
495 set(PIGLIT_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${PIGLIT_INSTALL_LIBDIR}")
497 set(PIGLIT_INSTALL_FULL_LIBDIR "${PIGLIT_INSTALL_LIBDIR}")
500 SET(CMAKE_INSTALL_RPATH "${PIGLIT_INSTALL_FULL_LIBDIR}/lib")
503 "${piglit_SOURCE_DIR}/tests/util/config.h.in"
504 "${piglit_BINARY_DIR}/tests/util/config.h"
507 include(cmake/piglit_util.cmake)
508 include(cmake/piglit_dispatch.cmake)
510 include_directories(src)
511 add_subdirectory(cmake/target_api)
512 add_subdirectory(generated_tests)
515 ##############################################################################
523 DESTINATION share/doc/piglit${PIGLIT_INSTALL_VERSION_SUFFIX}
528 DESTINATION ${PIGLIT_INSTALL_LIBDIR}
529 FILES_MATCHING PATTERN "*.py"
534 DESTINATION ${PIGLIT_INSTALL_LIBDIR}
539 DESTINATION ${PIGLIT_INSTALL_LIBDIR}
540 FILES_MATCHING REGEX ".*\\.(xml|xml.gz|py|program_test|shader_test|shader_source|frag|vert|geom|tesc|tese|comp|ktx|cl|txt|inc|vk_shader_test)$"
541 REGEX "CMakeFiles|CMakeLists|serializer.py|opengl.py|cl.py|quick_gl.py|glslparser.py|shader.py|quick_shader.py|no_error.py|llvmpipe_gl.py|sanity.py" EXCLUDE
545 DIRECTORY ${CMAKE_BINARY_DIR}/tests
546 DESTINATION ${PIGLIT_INSTALL_LIBDIR}
547 FILES_MATCHING REGEX ".*\\.xml.gz"
551 DIRECTORY ${CMAKE_BINARY_DIR}/generated_tests
552 DESTINATION ${PIGLIT_INSTALL_LIBDIR}
553 FILES_MATCHING REGEX ".*\\.(shader_test|program_test|frag|vert|geom|tesc|tese|comp|cl|txt|vk_shader_test)$"
554 REGEX "CMakeFiles|CMakeLists" EXCLUDE
558 DIRECTORY generated_tests
559 DESTINATION ${PIGLIT_INSTALL_LIBDIR}
560 FILES_MATCHING REGEX ".*\\.inc$"
561 REGEX "CMakeFiles|CMakeLists" EXCLUDE
564 if (BASH_COMPLETION_FOUND)
566 FILES completions/bash/piglit
567 DESTINATION ${CMAKE_INSTALL_PREFIX}/${BASH_COMPLETION_COMPLETIONSDIR}/
569 endif (BASH_COMPLETION_FOUND)
572 set (PYTHON_SUFFIX ".py")
574 set (PYTHON_SUFFIX "")
577 PROGRAMS piglit RENAME piglit${PIGLIT_INSTALL_VERSION_SUFFIX}${PYTHON_SUFFIX}
578 DESTINATION ${CMAKE_INSTALL_BINDIR}
582 set (CPACK_PACKAGE_VERSION_MAJOR "1")
583 set (CPACK_PACKAGE_VERSION_MINOR "0")
585 # Use current date in YYYYMMDD format as patch number
587 COMMAND ${PYTHON_EXECUTABLE} -c "import time, sys; sys.stdout.write(time.strftime('%Y%m%d'))"
588 OUTPUT_VARIABLE CPACK_PACKAGE_VERSION_PATCH
591 # cpack mistakenly detects Mingw-w64 as win32
593 if (CMAKE_SIZEOF_VOID_P EQUAL 8)
594 set (CPACK_SYSTEM_NAME win64)
598 # See http://www.vtk.org/Wiki/CMake:CPackPackageGenerators
600 set (CPACK_GENERATOR "ZIP")
602 set (CPACK_GENERATOR "TBZ2")