I have a project which installs various files into different components. It also uses CPack Archive generator to produce several archives. I tried to use
CPACK_INSTALL_SCRIPTS to add some extra files to the produced archives.
To be precise it was an attempt to build archives that have multiple built configurations for multi-configuration CMake generators. I.e., when
package target is running, say for the
Debug configuration, my custom script makes sure the
Release configuration for the current target also built and also performs install for it to the CPack’s temporary prefix.
The problem I’ve faced with:
cmCPackArchiveGenerator.cxx:367 uses per-component files collection (
cmCPackComponent::Files) populated at
cmCPackGenerator::InstallCMakeProject() which is not count any additional files installed to the temporary prefix ('cept for the files installed by
cmake_install.cmake for the selected configuration given via CLI).
My proposal is to perform
cmsys::Glob::FindFiles instead of the usage of incomplete files list (at
cmCPackArchiveGenerator.cxx:367). Taking into account that component-based archive generator sets individual temporary prefixes per-component this shouldn’t be a breaking change.