Hi,

I was looking into this yesterday, and it seems non-trivial as far as code
modifications go to make this happen.

But I wonder if this would even be the best way to go.
Having multiple ninja files would mean (as far as I understand) duplicating
lots of values in the sub ninja files.

I think it would be easier to just add a new target for each folder added
with 'EXCLUDE_FROM_ALL' that groups all the targets added within.
Maybe even adding such a target for each 'project', which regroups all the
targets of a project would make sense, as these are grouped as 'projects'
in MSVC, whereas a folder added with 'EXCLUDE_FROM_ALL' is added as a
'solution'.

This would make ninja easy to use in a fashion relatively similar to MSVC.

To avoid name collisions these could be suffixed with something like
'_dir', '_project' or such.

Do you think this would be a good enough solution ?

Le mer. 10 févr. 2016 à 19:47, Brad King <brad.k...@kitware.com> a écrit :

> On 02/10/2016 10:57 AM, Charles Huet wrote:
> > When using Unix Makefiles (or MSVC) this causes the subfolder to contain
> > a new Makefile, allowing me to build easily the whole subdir.
> >
> > I cannot find such a facility with Ninja
>
> The Makefile generator naturally lays makefiles out with launch points
> in each directory.  The Xcode generator and Visual Studio generators
> generate projects that can be loaded in the respective IDEs for each
> source directory with a project() command in its CMakeLists.txt file:
>
>
> https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalXCodeGenerator.cxx;hb=v3.4.3#l407
>
> https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalVisualStudio7Generator.cxx;hb=v3.4.3#l383
>
> They contain the relevant subsets of the build system needed for their
> subdirectories.  Currently the Ninja generator does not have this
> feature.  It may be possible to add but would take some investigation
> into how intrusive the changes would be.
>
> -Brad
>
>
-- 

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