-
Notifications
You must be signed in to change notification settings - Fork 175
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
If a name isn't provided, try to infer it from the git repo #202
Conversation
There was a problem hiding this 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, I think this is a great idea to shorten the syntax and avoid repetition!
Also feel free to update the main example in the readme to show off the shorter syntax! :-) |
- Also reordered tests to ensure that the result is actually unset when needed
Check. Suggested changes were added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for the changes!
Feature released in v0.30.0! 🎉 |
@TheLartians This is what it looks like right now:
I think it makes sense to highlight the keywords ExternalProject and FetchContent like this: Idea 1
I just learned right now as I wrote this that you can create a link for coded words with
Or like this: Idea 2
Edit: It's like this: [`ExternalProject`](https://cmake.org/cmake/help/latest/module/ExternalProject.html) |
@GunZi200 thanks for the suggestions! I think there are definitely some improvements that can be made to the readme. As the section you're referring to is written for users who already know both commands I think the link isn't necessary but highlighting the code does make sense. If you want, feel free to open a PR and we can discuss further changes there. |
Two reasons behind this PR
More compact CPMAddPackage calls
CPMAddPackage( GITHUB_REPOSITORY catchorg/Catch2 VERSION 2.5.0 )
Less room for error in pasting CPMAddPackage calls
To me, and I suspect to many other users most packages look like this:
When adding a new package, this gets pasted around and two identical occurrences of "PackageName" need to be replaced. If we follow the DRY principle, this repetition should be avoided and in the case of git repositories this is easy.
The old behavior still works for backwards compatibility and for the rare cases where the package name and the repo name aren't the same.