summaryrefslogtreecommitdiff
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
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>
-rw-r--r--.gitignore6
-rw-r--r--CMakeLists.txt66
-rw-r--r--cmake/piglit_util.cmake3
3 files changed, 75 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 911c26666..65ece5da3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,20 @@
.*.sw?
*.pyc
+*.tar.bz2
+*.zip
*~
/.ninja_log
/build.ninja
/rules.ninja
+_CPack_Packages
+
bin
lib
CMakeFiles
+CPackConfig.cmake
+CPackSourceConfig.cmake
Makefile
cmake_install.cmake
CMakeCache.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98fa71389..9c207f90f 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)
diff --git a/cmake/piglit_util.cmake b/cmake/piglit_util.cmake
index 382485bff..3a45e8a7d 100644
--- a/cmake/piglit_util.cmake
+++ b/cmake/piglit_util.cmake
@@ -62,6 +62,8 @@ function(piglit_add_executable name)
add_executable(${name} ${ARGV})
add_dependencies(${name} piglit_dispatch_gen)
+ install(TARGETS ${name} DESTINATION bin)
+
endfunction(piglit_add_executable)
#
@@ -79,6 +81,7 @@ function(piglit_add_library name)
add_library(${name} ${ARGV})
else(WIN32)
add_library(${name} SHARED ${ARGV})
+ install(TARGETS ${name} DESTINATION lib)
endif(WIN32)
add_dependencies(${name} piglit_dispatch_gen)