Suppress CMake external project 'update' phase #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug fix
Fixed bug
When the 'install' target is invoked during the Debian and RPM package builds, the external project target is re-evaluated to determine if it is stale. By default, CMake performs an 'update' command on the source repository, which invalidates the target and causes the external project to be re-built.
This is a problem because when the 'install' target is invoked by the Debian/RPM build, the 'DESTDIR' variable is passed, which makes its way into the external project as well. This interferes with the sub-project's installation into the build directory, and results in unexpected files getting installed into the platform package staging directory.
This is a problem for both Debian and RPM builds, but it is only a fatal error in RPM builds at the moment.
Fix applied
Using a ref which can never change and suppressing the 'update' phase of the external project is enough to ensure that the external project is not deemed 'stale' during the install target invocation, and avoids the problem.