aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2013-02-06 09:06:02 +0000
committerJosé Fonseca <jfonseca@vmware.com>2013-02-06 09:09:04 +0000
commitf232fa4d65b50d33f3e2c7721564e8ef57208880 (patch)
tree9dfd24e930552b95abfa57cbc2de274716ac21a6 /CMakeLists.txt
parent42a80f99c27f0d4dee6480ae2011ec364f2ccd04 (diff)
cmake: Allow to generate a tarball/zip with the binaries, scripts, data.
It doesn't make much sense to package piglit or install on machines, due to the frequency piglit tests are added/changed. However, binary packages are still useful for distributed testing where the binaries are built on one machine, and then passed to (sometimes other teams) for the actual testing. This patch allows one to conveniently generate such packages, simply by doing make package Then one can run piglit by unpacking the package elsewhere, set the PIGLIT_SOURCE_DIR and LD_LIBRARY_PATH accordingly, and run piglit scripts as usual. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt66
1 files changed, 66 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98fa7138..9c207f90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -273,3 +273,69 @@ include(cmake/piglit_dispatch.cmake)
include_directories(src)
add_subdirectory(cmake/target_api)
add_subdirectory(generated_tests)
+
+
+##############################################################################
+# Packaging
+
+install (
+ FILES
+ COPYING
+ README
+ RELEASE
+ DESTINATION share/doc
+)
+
+install (
+ PROGRAMS
+ piglit-merge-results.py
+ piglit-print-commands.py
+ piglit-run.py
+ piglit-summary-html.py
+ piglit-summary-junit.py
+ DESTINATION .
+)
+
+install (
+ DIRECTORY framework
+ DESTINATION .
+ FILES_MATCHING PATTERN "*.py"
+)
+
+install (
+ DIRECTORY tests
+ DESTINATION .
+ FILES_MATCHING REGEX ".*\\.(tests|program_test|shader_test|frag|vert|ktx|cl)$"
+)
+
+install (
+ DIRECTORY generated_tests
+ DESTINATION .
+ FILES_MATCHING REGEX ".*\\.(shader_test|program_test|frag|vert)$"
+)
+
+
+set (CPACK_PACKAGE_VERSION_MAJOR "1")
+set (CPACK_PACKAGE_VERSION_MINOR "0")
+
+# Use current date in YYYYMMDD format as patch number
+execute_process (
+ COMMAND ${python} -c "import time, sys; sys.stdout.write(time.strftime('%Y%m%d'))"
+ OUTPUT_VARIABLE CPACK_PACKAGE_VERSION_PATCH
+)
+
+# cpack mistakenly detects Mingw-w64 as win32
+if (MINGW)
+ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set (CPACK_SYSTEM_NAME win64)
+ endif ()
+endif ()
+
+# See http://www.vtk.org/Wiki/CMake:CPackPackageGenerators
+if (WIN32)
+ set (CPACK_GENERATOR "ZIP")
+else ()
+ set (CPACK_GENERATOR "TBZ2")
+endif ()
+
+include(CPack)