Commit f232fa4d authored by Jose Fonseca's avatar Jose Fonseca

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's avatarBrian Paul <brianp@vmware.com>
parent 42a80f99
.*.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
......
......@@ -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)
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment