All, this is one of those myriad of “CMake post install” issues. Essentially, I’m trying to figure out how I can run cpack after I run
make install and then install the bits that cpack just made into the installation directory.
More verbosely, what I’d like is that every time users run
make install for my code, I’d also like to make a tarball of the source code and then install that tarball into
CMAKE_INSTALL_PREFIX. (Why? Well, I work on a climate model and users have expressed a want to make sure they have the source code for every experiment they make which might be a single source code change they build, install, and make an experiment for.)
I already have a nice CPack setup that can do that with the usual
make package_source. But since
install isn’t like a “real” CMake target, all the easy ways I can think of doing this are hard (i.e., have the
package_source target depend on
install or some such).
Do I perhaps need to make a shell script called via
install(SCRIPT) that does what CPack would do for
make package_source (aka
tar czf ...) and then does a Linux
cp into the
CMAKE_INSTALL_PREFIX? Or is there some cool CMake I don’t know about that could help me do this more