Refactor YCMEPHelper to implement git safe clone (without delete) as an externally specified DOWNLOAD step #457
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.
Fix #50 .
Historically YCM relied on a fork of ExternalProject, that ensures that the
DOWNLOAD
step did not deleted existing source directory. This is important to ensure that you can create multiple different build directories of the same superbuild, without each build deleting the source folders (that are shared among builds). However, this fork of the ExternalProject was difficult to mantain, so in robotology/robotology-superbuild#1674 we switched to use the upstream CMake'sExternalProject
module.However, just using the vanilla CMake's
ExternalProject
module turned out to be too error prone, as any new build could just remove all the source directories of the superbuild, as found by @giotherobot . So, to restore the old behavior, I searched some way to implement the old behaviour on the top of the latest ExternalProject. It turns out that it was not too difficult, the important thing was to define a customDOWNLOAD_COMMAND
command to pass to theExternalProject_Add
function. In this PR, we move the logic that used to be in the fork of theExternalProject
module to some code that is stored inYCMEpHelper
, so that we keep the old behavior even when using the latestExternalProject
.