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><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">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 class="h5"><br>
<br>
On Thu, Oct 7, 2010 at 10:36 AM, Bill Hoffman <<a href="mailto:bill.hoffman@kitware.com">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">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>