-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Patch commands fail trying to re-apply the same patch twice #618
Comments
I'm seeing the same issue. If I choose "no" at the patch reverse step, the build fails because the patch fails to apply. If I choose "yes", then the patch is reversed and the library is no longer patched the way I need. It might be good to set a cache variable tracking each patch that has been applied and then skipping that patch on subsequent passes. |
For anyone else who finds this, here's my workaround: if (NOT TRACKTION_ENGINE_PATCHED)
set(TRACKTION_ENGINE_PATCHED TRUE CACHE INTERNAL "Whether to apply patches to Tracktion Engine")
CPMAddPackage(
NAME TracktionEngine
GITHUB_REPOSITORY Tracktion/tracktion_engine
VERSION 3.0
SOURCE_DIR ${DEPS_DIR}/tracktion_engine
# Prevent Tracktion Engine from compiling its examples.
PATCHES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/tracktion_engine.patch"
)
else()
CPMAddPackage(
NAME TracktionEngine
GITHUB_REPOSITORY Tracktion/tracktion_engine
VERSION 3.0
SOURCE_DIR ${DEPS_DIR}/tracktion_engine
)
endif() |
Have the same issue. Hope this gets fixed soon! |
The workaround works only when no CPM caching is used. Otherwise probably it needs to do something more reliable, like checking whether it was just freshly downloaded or not. |
Hmmm...it seems to work for me with CPM caching on (unless I'm misunderstanding what CPM caching does). In my project, I've set My work around is definitely less than ideal but should work; though I may be misunderstanding something. |
Due to a dependency with improper CMakeLists.txt I tried to use the
PATCHES
field, however the second time I run the configuration CMake fails duringFetchContent_MakeAvailable
for that package with this output:This is the relevant piece of my CMakeLists.txt:
The text was updated successfully, but these errors were encountered: