Overriding CPack variables

@craig.scott @ben.boeckel I’ve pushed my code to GitHub, it is intended to be a showcase of how to package the simplest of libraries using CPack witih using components.

I’ve confirmed that some of the variables in CPack are CACHE variables and can’t be overriden simply, they have to be unset first, otherwise nothing has meaningful effect. However even if I unset them, set them to the value I want (print the whole process using message commands), when the packages get generated, the change has no effect.

What I want to do is create binary packages for all the components, and create source packages using both the TGZ and the DEB generators. The TGZ tarball should have just the source tree in it, while the DEB source package should have a name format like the binary packages (libuserful-src_0.1.deb) and the packaged install root should be /usr/src/libuseful, but I can’t seem to make it so that I can build both source packages from the same configuration. I’d need cpack-time control over CPACK_PACKAGING_INSTALL_PREFIX and CPACK_SOURCE_INSTALLED_DIRECTORIES, with potentially these having defaults set in the configuration script, but I could let go of that.

I’ve had a similar issue a while ago, and even then I found no real solution beside setting variables in the configure script before include(CPack) and doing multiple configurations.