How to make changes to scripts and patch files used in PATCH_COMMAND rebuild ExternalProject?

I have an ExternalProject_Add with a PATCH_COMMAND bash that applies various patch files. How can I get the project to be updated when I modify the script or patch files?

ExternalProject_add_step(DEPENDS) is what you want. There’s no access to this from the “builtin” steps though. We did notice this in one of our projects recently, so it’s on my radar now at least. Note that the superbuild ships its own ExternalProject copy, so it’s a good place for prototyping

FYI @craig.scott

Near-simultaneous bug discovery is always fun :slight_smile: .

Thanks for the explanation and for looking into a fix!

And it was actually pretty easy:

Once I have it tested in our consumers of the common-superbuild, I’ll look at submitting it to CMake itself (for 3.28).