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
Use ${PROJECT_NAME} instead of writing projectname multiple times #133
Comments
OK, but do not forget the spaces! |
Should I maybe create a pull request? |
I think the main reason I didn't use it was for consistency with the derived targets ( |
Fair point. If you want I will create a pull request if not its also fine |
Hm I do see the advantages of avoiding redundancy. On the other hand, sometime it may be better to be explicit and see directly what the target in question is. Any idea how other popular C++ projects handle this? |
Some examples I found: https://github.com/nlohmann/json/blob/develop/CMakeLists.txt However I can Still for me redundancy is always bad. So im curious when do you think it makes sense to not use the ${PROJECT_NAME}? |
Cool thanks for the list! So it seems that quite a few libraries do use the project name or other variables to define the library name.
TBH not much, just that at the time I didn't have strong flinging and I felt that many projects were explicit in their target naming. Imo it may actually be good idea to use it, especially as we are already using Would be happy to review a PR for your branch! |
Is there a reason ${PROJECT_NAME} is not used?
I thought this is the recommended way to go about it?
Also it makes it easier to do the initial setup with your template.
Example:
Instead of:
use :
The text was updated successfully, but these errors were encountered: