<div dir="ltr">Hi,<div><br></div><div>I was looking into this yesterday, and it seems non-trivial as far as code modifications go to make this happen.</div><div><br></div><div>But I wonder if this would even be the best way to go.</div><div>Having multiple ninja files would mean (as far as I understand) duplicating lots of values in the sub ninja files.</div><div><br></div><div>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.</div><div>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'.</div><div><br></div><div>This would make ninja easy to use in a fashion relatively similar to MSVC.</div><div><br></div><div>To avoid name collisions these could be suffixed with something like '_dir', '_project' or such.</div><div><br></div><div>Do you think this would be a good enough solution ?</div></div><br><div class="gmail_quote"><div dir="ltr">Le mer. 10 févr. 2016 à 19:47, Brad King <<a href="mailto:brad.king@kitware.com">brad.king@kitware.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 02/10/2016 10:57 AM, Charles Huet wrote:<br>
> When using Unix Makefiles (or MSVC) this causes the subfolder to contain<br>
> a new Makefile, allowing me to build easily the whole subdir.<br>
><br>
> I cannot find such a facility with Ninja<br>
<br>
The Makefile generator naturally lays makefiles out with launch points<br>
in each directory.  The Xcode generator and Visual Studio generators<br>
generate projects that can be loaded in the respective IDEs for each<br>
source directory with a project() command in its CMakeLists.txt file:<br>
<br>
 <a href="https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalXCodeGenerator.cxx;hb=v3.4.3#l407" rel="noreferrer" target="_blank">https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalXCodeGenerator.cxx;hb=v3.4.3#l407</a><br>
 <a href="https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalVisualStudio7Generator.cxx;hb=v3.4.3#l383" rel="noreferrer" target="_blank">https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalVisualStudio7Generator.cxx;hb=v3.4.3#l383</a><br>
<br>
They contain the relevant subsets of the build system needed for their<br>
subdirectories.  Currently the Ninja generator does not have this<br>
feature.  It may be possible to add but would take some investigation<br>
into how intrusive the changes would be.<br>
<br>
-Brad<br>
<br>
</blockquote></div>