<div class="gmail_quote">On Fri, Apr 17, 2009 at 10:19 PM, Alexander Neundorf <span dir="ltr">&lt;<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Friday 17 April 2009, Hugo Heden wrote:<br>
&gt; The following example illustrates a possible bug.<br>
&gt;<br>
&gt; Consider the following CMakeLists.txt code. This little &quot;project&quot; should<br>
&gt; fail when the target MyTarget is built (because one of the POST_BUILD<br>
&gt; custom commands fails).<br>
&gt;<br>
&gt; ===========================<br>
&gt; cmake_minimum_required(VERSION 2.6)<br>
&gt;<br>
&gt; PROJECT( test )<br>
&gt;<br>
&gt; ADD_CUSTOM_TARGET( MyTarget<br>
&gt;   COMMENT &quot;This is MyTarget&quot;<br>
&gt; )<br>
&gt;<br>
&gt; ADD_CUSTOM_COMMAND(<br>
&gt;     TARGET MyTarget<br>
&gt;     POST_BUILD<br>
&gt;     COMMAND cmake -E blablablahh # Error (intentional error, to illustrate<br>
&gt; buggy behaviour.)<br>
&gt;     VERBATIM<br>
&gt;     )<br>
&gt;<br>
&gt; ADD_CUSTOM_COMMAND(<br>
&gt;    TARGET MyTarget<br>
&gt;    POST_BUILD<br>
&gt;    COMMAND cmake -E echo &quot;hello there&quot; # Success.<br>
&gt;    VERBATIM<br>
&gt; )<br>
&gt; =============================<br>
&gt;<br>
&gt; However, running<br>
&gt;<br>
&gt;   &gt; cmake -G &quot;Visual Studio 9 2008&quot; ..\source<br>
&gt;   &gt; devenv test.sln /Build Debug /Project MyTarget.vcproj<br>
&gt;<br>
&gt; succeeds, which is not expected. (Right?).<br>
&gt;<br>
&gt; The problem seems to be that a succeeding custom command comes after the<br>
&gt; failing one, and this sort of *hides* the failure somehow.. The fact that<br>
&gt; failures are hidden like this is of course dangerous. (We have tests that<br>
&gt; have been failing like this for a while that have not shown up as error in<br>
&gt; our nightly builds.) When using other Generators and build tools (I have<br>
&gt; tested with &quot;NMake Makefiles&quot; -- nmake on Windows and &quot;Unix Makefiles&quot; --<br>
&gt; Gnu-make on Linux) the build phase fails as expected.<br>
&gt;<br>
&gt;   &gt; cmake --version<br>
&gt;<br>
&gt;   cmake version 2.6-patch 2<br>
&gt;<br>
&gt; Any comments?<br>
<br>
</div></div>Please report this as a bug in the bug tracker.<br>
</blockquote><div><br>Done, see <a href="http://public.kitware.com/Bug/view.php?id=8906">http://public.kitware.com/Bug/view.php?id=8906</a><br><br>/Hugo Heden<br><br></div></div>