I do have some problems with naming my targets / project. I do have a project / group called
my_project and then multiple seperate repos, which mostly all define one library.
Currently my projects therefore have the project name
my_project_my_library_name and targets with the same name
my_project_my_library_name. And the exported / alias name is then:
my_project_my_library_name::my_project_my_library_name. Which doesn’t feel quite right.
I would prefer my alias targets to be
my_project::my_library_name. But it seems kind of best practice that the alias target name always include the project name (this is also enforced by some cmake function in ROS2, which I’m using). So in order to get that I would need to set the project name to
my_project only. But this seems bad to me, because then multiple repositories would have the same project name.
I also thought about something like:
- project name:
- target name:
- Export / Alias:
my_project_my_library_name_lib::lib(Because I know it is possible and common to remove the project name of the target name in this alias notation).
But yeah I’ve never seen someone doing it like this. In fact I see it quite often thar project / target names are the same and thus it is just
name::name. But usually the name then is short, so it’s not that bad. But still it feels weird.
I wonder what some best practices might be in this case. Other people must have the same problems