-
Notifications
You must be signed in to change notification settings - Fork 190
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
Issue with CPM PATCHES "Reversed (or previously applied) patch detected!" #596
Comments
This is a duplicate of #577. Maybe go up vote it and close this? The work around for this is to set # ~/.bashrc
# This is the cache location for CPM and allows for much faster builds from a clean state.
export CPM_SOURCE_CACHE=$HOME/.cache/CPM |
I did not see that issue, thank you! |
Therefore, the only solution is to set |
Maybe we can add this to the README? 😅 |
Maybe, but maybe we should just fix the problem itself? |
I agree with you. |
I think #559 may go along way to getting this to work... |
I think this issue should be reopened |
I am doing something similar to #559 on my side as a workaround set(PATCHES_LIST "")
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/patches_applied")
set(PATCHES_LIST "${CMAKE_CURRENT_LIST_DIR}/library_patch.patch")
file(TOUCH "${CMAKE_CURRENT_BINARY_DIR}/patches_applied")
endif()
...
CPMAddPackage(
GIT_REPOSITORY ""
PATCHES ${PATCHES_LIST}
) I agree with @carlocorradini this should be documented behavior on the Readme or CPM should support it directly |
This was closed as a duplicate of #577. |
Is there a possibility to check if the patch has already been applied? |
Hello,
I am encountering a problem while trying to add cmocka to my cmake project using CPM. Due to internal conflicts between my toolchain file and the cmocka generation process, I have to patch some of their cmake files. To do so, I am using the PATCHES keyword and passing a list of patch files. The first configure runs perfect but subsequent reconfigurations fail with the following error:
It seems that the failure is due to an attempt to reapply the patches when reconfiguring. This causes the problem to stop the reconfigure process because the patch command returns an error.
If so, I believe the PATCHES keyword should check whether the patches have already been applied. git apply can check it using
Otherwise is there any workaround to ensure patches are only applied if they have not been applied already?
Thank you for your help!
The text was updated successfully, but these errors were encountered: