[cmake-developers] Ninja generator on Windows

Bill Hoffman bill.hoffman at kitware.com
Sat Feb 4 05:48:24 EST 2012


>>
>> Why does the ninja generator need to use&&?  I am pretty sure the other
>> CMake generators do not need to use&&.
>>
>
> Most of them come from the working directory: cd foo&&  g++
> They could be worked around easly by adding a new variable to the rules.
>
Seems like there should be a better way to run a command in a directory. 
  Does ninja have a working directory at all?  I guess you are saying 
there is a way to do this with a variable in the rules... Not sure what 
that means, but if it works... :)
> Others comes from the support of PRE_BUILD, POST_BUILD, and custom
> target / commands with more than one command. In ninja, contrary to
> make, when specifying a build statement (e.g. foo.o: foo.c foo.h) you
> can "attach" only one rule (e.g. one command) and not several like in
> make.
>
Right, so, if there is more than one command, you can turn it into one 
command by creating a small cmake script that runs consecutive 
execute_process calls.

> They have been several discussion thread for adding basic "shell"
> features like in Ninja:
> - redirection
> - environment variable
> - working directory
> - chainning
>
> There is no patch proposal yet AFAIK.
Sure, so until then, I think the above should be fine to get this 
working on windows.  No one should be depending on redirection or 
chaining in cmake projects.

-Bill



More information about the cmake-developers mailing list