<div dir="ltr">Ben,<div><br></div><div>I have pushed a first draft of the patch here:</div><div><br></div><div><a href="https://github.com/nicolasdespres/CMake/commit/67a4faad47378c07c97a29dd229d6f9fa500763b">https://github.com/nicolasdespres/CMake/commit/67a4faad47378c07c97a29dd229d6f9fa500763b</a><br></div><div><br></div><div>I have tested with a small project and it looks good.</div><div><br></div><div>I would like to add some regression tests but I don't know from where to start.</div><div><br></div><div>The principle would be to duplicate and modify existing tests so that CMAKE_NINJA_OUTPUT_PATH_PREFIX is set to "sub/" and the build directory is changed from _build to _build/sub. A dummy build.ninja file containing "subninja sub/build.ninja" should be generated in _build/build.ninja and ninja should be called from _build instead of _build/sub.</div><div><br></div><div>It would be great if you could point me some existing tests that could serve as a base to do the above.</div><div><br></div><div>Cheers,</div><div>Nicolas</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 6, 2016 at 7:46 PM, Nicolas Desprès <span dir="ltr"><<a href="mailto:nicolas.despres@gmail.com" target="_blank">nicolas.despres@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Wed, Jan 6, 2016 at 7:35 PM, Ben Boeckel <span dir="ltr"><<a href="mailto:ben.boeckel@kitware.com" target="_blank">ben.boeckel@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Wed, Jan 06, 2016 at 19:26:11 +0100, Nicolas Desprès wrote:<br>
> Is that variable already available or a name suggestion? I cannot find any<br>
> reference to it neither in the source nor in the documentation.<br>
<br>
</span>It's a suggestion.<br></blockquote><div> </div></span><div>Ok, works for me too. </div><span class=""><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><br>
> This is acceptable for me since I have a custom generator that would write<br>
> the top build.ninja containing "subninja sub/build.ninja". The end-user is<br>
> supposed to run ninja from the top directory not from the top/sub/<br>
> directory.<br>
<br>
</span>It looks like subclassing cmLocalNinjaGenerator to override some<br>
path-related bits and it should work (though it has changed enough with<br>
cmState that I can't tell what exactly without doing more digging).<br>
<br>
The hardest problem is going to be with testing. Every generate step<br>
will also have to dump a build.ninja file out so that it can be properly<br>
tested.<br>
<br>
Brad is back later this week and may have other ideas too.<br>
<span><font color="#888888"><br></font></span></blockquote></span><div>I will try to have a patch working on a helloworld project first and I will get back to you for the testing part. That would be the hardest part indeed.</div><div></div></div><div class="gmail_extra"><br></div>Thanks for your help.<span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div>Nicolas Desprès<br></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Nicolas Desprès<br></div>
</div>