On the other hand, with Visual Studio, it's all a big hairy mess..... because the setting for "how many parallel projects to build simultaneously" is a single top level global setting. So when we spawn sub-VS instances in VS 2008, for example, each one uses "N" for its parallel setting.<div>
<br></div><div>In that case, I typically recommend setting that "N" to be half to a quarter of your processors available, assuming that there will be between 2 and 4 (on average) projects building simultaneously.</div>
<div><br><br><div class="gmail_quote">On Thu, Oct 7, 2010 at 11:55 AM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
If you use "$(MAKE)" in a BUILD_COMMAND, then the literal "$(MAKE)" appears in the generated makefiles.<div><br></div><div>That tells the top level make to spawn sub-makes with the job controller from the top level make.</div>
<div><br></div><div>Then you do not need to specify any -j flags anywhere except at the top level.</div><div><br></div><div>And then, the top level job controller makes sure there are only N concurrent things happening regardless of the level of sub-makes...</div>
<div><br></div><div>Does that "make" sense?</div><div><br></div><div><br></div><div>:-)</div><div>David</div><div><div></div><div class="h5"><div><br><br><div class="gmail_quote">On Thu, Oct 7, 2010 at 11:52 AM, kent williams <span dir="ltr"><<a href="mailto:nkwmailinglists@gmail.com" target="_blank">nkwmailinglists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">1. Is that $(MAKE) or is it ${MAKE} ? One thing missing from the<br>
CMake documentation -- unless I'm mistaken there's not much<br>
explanation of CMake syntax in the documentation.<br>
<br>
2. I think it's probably not what one intends to have 'make -j4' (for<br>
example) used every time make is invoked. If you configure a program<br>
that includes several ExternalProjects, then it would spawn 4<br>
concurrent builds of those ExternalProjects, and then each of those<br>
builds would spawn 4 make steps at once, for 16 concurrent processes.<br>
<div><div></div><div><br>
<br>
On Thu, Oct 7, 2010 at 10:36 AM, Bill Hoffman <<a href="mailto:bill.hoffman@kitware.com" target="_blank">bill.hoffman@kitware.com</a>> wrote:<br>
> On 10/7/2010 11:25 AM, kent williams wrote:<br>
>><br>
>> On Wed, Oct 6, 2010 at 5:01 PM, Clifford Yapp<<a href="mailto:cliffyapp@gmail.com" target="_blank">cliffyapp@gmail.com</a>> wrote:<br>
>>><br>
>>> I use $(MAKE) in my BUILD_COMMAND and that seems to do OK, although I<br>
>>> don't know if it works universally.<br>
>>><br>
>><br>
>> That's an environment variable, as near as I can tell and isn't<br>
>> mentioned in the current CMake documentation. So it's probably not the<br>
>> best thing to do.<br>
>><br>
>> upon reflection, this would be a little safer:<br>
>><br>
>> if("${CMAKE_GENERATOR}" STREQUAL "Unix Makefiles")<br>
>> set(BUILD_COMMAND_STRING "${CMAKE_MAKE_PROGRAM} -j4")<br>
>> else()<br>
>> set(BUILD_COMMAND_STRING "$(CMAKE_MAKE_PROGRAM)")<br>
>> endif()<br>
><br>
> By using $(MAKE), the toplevel -j N option should be passed down. The 2.8.3<br>
> RC that is out now has some fixes in this area.<br>
><br>
><br>
> -Bill<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>