Ben,

I have pushed a first draft of the patch here:

https://github.com/nicolasdespres/CMake/commit/67a4faad47378c07c97a29dd229d6f9fa500763b

I have tested with a small project and it looks good.

I would like to add some regression tests but I don't know from where to
start.

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.

It would be great if you could point me some existing tests that could
serve as a base to do the above.

Cheers,
Nicolas

On Wed, Jan 6, 2016 at 7:46 PM, Nicolas Desprès <nicolas.desp...@gmail.com>
wrote:

>
>
> On Wed, Jan 6, 2016 at 7:35 PM, Ben Boeckel <ben.boec...@kitware.com>
> wrote:
>
>> On Wed, Jan 06, 2016 at 19:26:11 +0100, Nicolas Desprès wrote:
>> > Is that variable already available or a name suggestion? I cannot find
>> any
>> > reference to it neither in the source nor in the documentation.
>>
>> It's a suggestion.
>>
>
> Ok, works for me too.
>
>
>> > This is acceptable for me since I have a custom generator that would
>> write
>> > the top build.ninja containing "subninja sub/build.ninja". The end-user
>> is
>> > supposed to run ninja from the top directory not from the top/sub/
>> > directory.
>>
>> It looks like subclassing cmLocalNinjaGenerator to override some
>> path-related bits and it should work (though it has changed enough with
>> cmState that I can't tell what exactly without doing more digging).
>>
>> The hardest problem is going to be with testing. Every generate step
>> will also have to dump a build.ninja file out so that it can be properly
>> tested.
>>
>> Brad is back later this week and may have other ideas too.
>>
>> 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.
>
> Thanks for your help.
>
> --
> Nicolas Desprès
>



-- 
Nicolas Desprès
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to