Skip to content
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

ci(cmake): split additional_commands to its own file #486

Merged

Conversation

JohelEGP
Copy link
Contributor

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 own format is overwritten.

In this PR, I split the additional_commands in .cmake-format to under cmake/.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-formatted
just need to add include: ["cmake/.cmake-format-additional_commands-cpm"] to their .cmake-format.

Copy link
Member

@TheLartians TheLartians left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Splitting the code for CPM commands makes a lot of sense.

@TheLartians TheLartians merged commit cda03b4 into cpm-cmake:master Aug 19, 2023
8 checks passed
@JohelEGP JohelEGP deleted the cmake-format-additional_commands branch August 19, 2023 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants