On Mon, May 23, 2011 at 4:13 AM, Marcel Loose <span dir="ltr">&lt;<a href="mailto:loose@astron.nl">loose@astron.nl</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi all,<br>
<br>
A colleague of mine reported a bug in our CMake-base build system when<br>
doing a parallel build of multiple targets where one of the targets is<br>
&#39;test&#39;.<br>
<br>
&lt;quote&gt;<br>
        Running &#39;make -j16 tMutex test&#39; (or any test other than tMutex)<br>
        for example will result in building tMutex in parallel to<br>
        testing it.<br>
<br>
        Expected behaviour is first building tMutex, followed by running<br>
        the tests.<br>
&lt;/quote&gt;<br>
<br>
Is this indeed a bug? Either in our build system or in CMake?<br>
AFAIK it is not possible to define dependencies between the &#39;test&#39;<br>
target and the target to build the test program. Correct?<br>
<br>
Best regards,<br>
Marcel Loose.<br>
<br>
<br>
--<br>
Marcel Loose<br>
Senior Software Engineer, Computing Group R&amp;D, Astron, the Netherlands<br>
<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>
</blockquote></div><br><div>To the best of my knowledge you can only do a parallel make of one target at a time.</div><div><br></div><div>The best way to do what you want is to do two parallel make runs in sequence, like this:</div>
<div><br></div><div>  make -j16 tMutex</div><div>  make -j16 test</div><div><br></div><div>The test target is defined by CMake, though, and runs all tests.</div><div><br></div><div>HTH,</div><div>David</div><div><br></div>