ci(cmake): split additional_commands to its own file #486
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.
I'm an user of
cmake-format
.I'd like to make use of the
additional_commands
defined in this repository's.cmake-format
.So I setup my build to copy it to
cmake/.cmake-format-additional_commands-cpm
.Unfortunately, that includes the
format
portion.And it seems that
cmake-format
processes those last, so my ownformat
is overwritten.In this PR, I split the
additional_commands
in.cmake-format
to undercmake/.cmake-format-additional_commands-cpm
.To avoid polluting the top-level, I reuse existing
cmake
directory.I prefer this approach to splitting because it makes updating the resulting config file a simple CMake
file(COPY_FILE)
call.Now, users of
cmake-format
that want their calls to CPM functions well-formattedjust need to add
include: ["cmake/.cmake-format-additional_commands-cpm"]
to their.cmake-format
.