[cmake-developers] Supported targets with the ninja generator ?

David Cole david.cole at kitware.com
Sat May 5 10:53:23 EDT 2012


On Fri, May 4, 2012 at 8:35 AM, Nicolas Desprès
<nicolas.despres at gmail.com> wrote:
> On Thu, Apr 19, 2012 at 5:11 PM, Nicolas Desprès
> <nicolas.despres at gmail.com> wrote:
>> 2012/4/5 Nicolas Desprès <nicolas.despres at gmail.com>:
>>> On Thu, Apr 5, 2012 at 9:44 PM, David Cole <david.cole at kitware.com> wrote:
>> [...]
>>>>
>>>> It would be very simple to add a "clean" target that simply executes
>>>> "ninja -t clean" as a custom command, if the ninja generator guys
>>>> think that's a reasonable idea to keep things similar to the Makefiles
>>>> generator.
>>>
>>> Sounds reasonnable.
>>>
>>
>> I have just pushed on my GitHub CMake fork a branch called
>> 'ninja_convenience_targets' that implement that:
>> https://github.com/polrop/CMake/commits/ninja_convenience_targets
>>
>
> I know this branch does not solved all the issues mentioned in this
> thread but it is a good start. Could somebody have a look at them
> David please?
>
> @alex This is not Ninja philosophy to add such target name so I have
> added them only because you ask for them for Eclipse. I hope they will
> help you. For your information, I have tried (without any hope) to add
> them to Ninja it self (https://github.com/martine/ninja/pull/275 and
> https://github.com/martine/ninja/pull/276) but they have been
> rejected.
>
> Thanks,
>
> --
> Nicolas Desprès


Implementing these as custom targets in the Ninja generator in CMake
is definitely the right way to go. Ninja does not need knowledge of
these targets whatsoever. (Make has none, we just generate these
convenience targets for CMake projects that use the Unix Makefiles
generator...)

The point of this whole thread is that the Ninja generator falls short
of the Unix Makefiles generator in terms of its support of these
custom targets.

The changes to CMake look good to me (just inspecting the code, didn't
try it). Can somebody take Nicolas's patches and get them merged to
'next' in CMake?


Thx,
David



More information about the cmake-developers mailing list