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
Adding PATCHES keyword. #558
base: master
Are you sure you want to change the base?
Conversation
@ScottBailey I tried this For my own setup it works as expected: It applies patches But with docker linux I got a bug : It doesn't apply patches. Here's the branch with my attempt to test it. Try I don't know why in the docker image it fails and on my native machine it works correctly. We need further investigation. |
Hm, it seems removing CPM_SOURCE_CACHE triggers the error |
Cool, thanks! If I have time, I'll investigate tomorrow. Truthfully, patching in CMake has a lot of problems. It's not going to work in all cases. Where it fails, Ultimately, it makes dependency management much more convenient and intuitive. |
I tried some debugging when it happens ( when CPM_SOURCE_CACHE is not set) It seems to not invoke your function because of an if statement |
Good catch, I think I may have fixed it in 311cd3f. |
Yep, it seems to work now. Good job! |
Will close #494 |
The PATCHES command is currently a gaping hole in CMake's @Gerodote Please feel free to review and comment on the change. |
This PR makes the following changes:
PATCHES
multi-value keyword added toCPMAddPackage()
Example usage:
Patches are applied in the order listed using the
patch
executable. In case of a Windows host, ifpatch.exe
is not immediately found, a second search forpatch.exe
alongsidegit.exe
is performed.This code change is essentially syntactical sugar. We take the element(s) from
PATCHES
and put them together with&&
s behind aPATCH_COMMAND
that is added toCPM_ARGS_UNPARSED_ARGUMENTS
.This functionality is available manually, but it's quite ugly.
The above command written manually looks something like this: