<div class="gmail_quote">On Fri, Apr 17, 2009 at 10:19 PM, Alexander Neundorf <span dir="ltr"><<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>></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>
> The following example illustrates a possible bug.<br>
><br>
> Consider the following CMakeLists.txt code. This little "project" should<br>
> fail when the target MyTarget is built (because one of the POST_BUILD<br>
> custom commands fails).<br>
><br>
> ===========================<br>
> cmake_minimum_required(VERSION 2.6)<br>
><br>
> PROJECT( test )<br>
><br>
> ADD_CUSTOM_TARGET( MyTarget<br>
> COMMENT "This is MyTarget"<br>
> )<br>
><br>
> ADD_CUSTOM_COMMAND(<br>
> TARGET MyTarget<br>
> POST_BUILD<br>
> COMMAND cmake -E blablablahh # Error (intentional error, to illustrate<br>
> buggy behaviour.)<br>
> VERBATIM<br>
> )<br>
><br>
> ADD_CUSTOM_COMMAND(<br>
> TARGET MyTarget<br>
> POST_BUILD<br>
> COMMAND cmake -E echo "hello there" # Success.<br>
> VERBATIM<br>
> )<br>
> =============================<br>
><br>
> However, running<br>
><br>
> > cmake -G "Visual Studio 9 2008" ..\source<br>
> > devenv test.sln /Build Debug /Project MyTarget.vcproj<br>
><br>
> succeeds, which is not expected. (Right?).<br>
><br>
> The problem seems to be that a succeeding custom command comes after the<br>
> failing one, and this sort of *hides* the failure somehow.. The fact that<br>
> failures are hidden like this is of course dangerous. (We have tests that<br>
> have been failing like this for a while that have not shown up as error in<br>
> our nightly builds.) When using other Generators and build tools (I have<br>
> tested with "NMake Makefiles" -- nmake on Windows and "Unix Makefiles" --<br>
> Gnu-make on Linux) the build phase fails as expected.<br>
><br>
> > cmake --version<br>
><br>
> cmake version 2.6-patch 2<br>
><br>
> 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>