[cmake-developers] Invalid/Reserved target names
Nils Gladitz
nilsgladitz at gmail.com
Fri Nov 15 12:40:58 EST 2013
On 15.11.2013 17:24, Matthew Woehlke wrote:
> I haven't done so yet, but I've considered once or twice creating a
> 'clean' target in case the generator is ninja. Possibly someone has
> already done that. Maybe only disallow target names that the generator
> actually uses? (Or should we teach CMake to make a 'clean' target for
> ninja? :-) That could probably be done separately, but if 'clean' is
> disallowed unconditionally it feels like that should be "on the radar"
> of things to do.)
>
I would prefer to forbid them regardless of generator.
This would prevent someone using a target that happens to be free for
his generator but inadvertently breaking something for someone else
working on the same project with a different generator.
Defining a custom "clean" target would also break if the Ninja generator
did start defining a custom clean target ... which obviously can happen
for any target name not currently used but is more likely with the
currently "reserved" names.
Projects that already use these names should still work if I make this
dependant on the existing policy.
Nils
More information about the cmake-developers
mailing list