You can use the CMake target to invoke CMake in command mode and create a tarball from binary files in the output directory. Here is CMakeLists.txt, which sketches the necessary steps:
project(TarExample) set (EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/executables") add_executable(foo foo.cpp) add_custom_target(create_tar ALL COMMAND ${CMAKE_COMMAND} -E tar "cfvz" "executables.tgz" "${EXECUTABLE_OUTPUT_PATH}") add_dependencies(create_tar foo)
The custom target creates a gzipped tarball from the files in the EXECUTABLE_OUTPUT_PATH directory. Calling add_dependencies ensures that the tarball is created as the last step.
To create an uncompressed tarball, use cfv instead of cfvz .
sakra source share