Gather resource dependencies by executing corrade-rc instead of a nasty CMake regex #131
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Oh come on, what happened lately that my every attempt to implement anything results in stashing the unfinished work to a WIP branch because I hit a wall?!)
This will allow for much easier modifications to the resource file format, such as shorthand lists or directory globbing. Or to projects that use a custom buildsystem (such as #114) and thus would have to reimplement that nasty regex themselves to get proper dependency tracking in incremental builds.
But of course it would work only in projects using Corrade and not in Corrade itself! Because guess what, at the time I need to gather dependencies, I don't yet have the
corrade-rc
executable built. So I can't use it inexecute_process()
, but only later inadd_custom_command()
, which means it can't know the dependency tree until it actually starts building stuff. And that's quite shit. TODOs / alternatives:DEPFILE
option inadd_custom_command()
which could solve this, but its syntax is far more than just a list of files, its support is sparse, and mostly just in newer CMakes. So a no-go.Or I would need to keep the nasty regex in there for when usingWouldn't work when CMake subprojects are involved.corrade_add_resource()
right inside Corrade, and switch to the clean option only in dependent projects, but that doesn't fix the problem of having to maintain two different parsers for the same thing which I wanted to avoid in the first place.Or maybe restricting the use in Corrade itself to just something that doesn't make the CMake regex too nasty? Like, just the long version, no globs, ... Feels strange tho.Neither this would work when CMake subprojects are involved.