I have used the *_OUTPUT_PATH variables in my CMakeLists.txt file to specify specific locations for my binaries and library files, and that seems to be working “automatically”
I would like as part of a “build” for one final step to happen, which is to create a tarball of the binaries that output directory.
What do I need to add to create a tar?
You can use a CMake custom target to invoke CMake in command mode and have it produce a tarball from the binaries in the output directory. Here is a CMakeLists.txt that sketches the necessary steps:
The custom target generates a gzipped tarball from the files in the directory
EXECUTABLE_OUTPUT_PATH. Theadd_dependenciescall ensures that the tarball is created as a final step.To produce an uncompressed tarball, use the option
cfvinstead ofcfvz.