Skip fetch only works when CPM_SOURCE_CACHE
is defined · Issue #577 · cpm-cmake/CPM.cmake (original) (raw)
When the environment variable CPM_SOURCE_CACHE
is set, re-running cmake does not cause a fetch and patch.
When unset, fetch and patch both occur.
The problem observed (see #572 for more discussion) is that the unset path fetch does not overwrite the source and so the patch command fails.
#572 suggests a fix that could ignore errors during patching. I think this could be an issue when a user is testing version updates; it would be nice if we just, say, updated package A to latest version and running CMake told us the patches were incompatible/not applied. I don't think -t
reports that?
In my testing, I see that when the environment variable is set, we skip the fetch and patch steps. Maybe we can add a cache variable to indicate the initial fetch and patch skips were successful?
Recreation of this is relatively simple, see https://github.com/ScottBailey/cpm-cmake-test-577 for an automated working example.