In our monorepo, for every target we create a component for executable/shared library itself and another component for its runtime dependencies. We are doing runtime dependency installation via install(RUNTIME_DEPENDENCY_SET)
. This is great for us as it brings us a great granularity, we can easily mix and match different components into a cpack script and using ALL_COMPONENTS_IN_ONE
we can generate one big release file. However downside of this is most of our targets use mostly the same dependencies, and CPacks’s Archive Generator doesn’t differentiate same files of different components, thus our archive generation takes unnecessary long and the release file gets unnecessary big.
What I did is adding a filename cache for cmCPackArchiveGenerator::addOneComponentToArchive
and if that path is already added to the archive (and obviously cache), skip it. The results are great, times are down from 1m30,359s to 0m23,434s. The file size shrank too, from 850 MB to 124 MB. Would it be acceptable if I submit a merge request to add a flag for this? Something like CPACK_ARCHIVE_ALL_IN_ONE_DEDUPLICATE
?