[cmake-developers] [CMake 0011533]: Custom build step in MSVS 10 fails
Mantis Bug Tracker
mantis at public.kitware.com
Mon Nov 29 05:22:20 EST 2010
The following issue has been SUBMITTED.
======================================================================
http://www.cmake.org/Bug/view.php?id=11533
======================================================================
Reported By: Alexander Ivaniuk
Assigned To:
======================================================================
Project: CMake
Issue ID: 11533
Category: CMake
Reproducibility: always
Severity: block
Priority: normal
Status: new
======================================================================
Date Submitted: 2010-11-29 05:22 EST
Last Modified: 2010-11-29 05:22 EST
======================================================================
Summary: Custom build step in MSVS 10 fails
Description:
Custom build step that was correctly working in Visual Studio 2010 with CMake
2.8.1 fails with CMake 2.8.3.
I'm using Visual Studio 10. This morning after updating CMake to version 2.8.3
from 2.8.1 found that a custom build step of our project fails with message "The
system cannot find the batch label specified - VCReportError". I opened property
pages for the project and found that custom build step now looks like:
<command1>
if errorlevel 1 goto VCReportError
<command2>
if errorlevel 1 goto VCReportError
<command3>
if errorlevel 1 goto VCReportError
and really there is no label "VCReportError"!
I dug into the source of CMake and found that from version CMake 2.8.2 file
cmLocalVisualStudioGenerator.cxx contains the following code
line:258
script += "echo Error in " + errorMsg;
script += newline_text;
script += "goto VCReportError";
script += newline_text;
script += ")";
}
return script;
It looks like somebody was writing code for earlier versions of Visual Studio
where AFAIN this label presents by default.
So:
1) it really breaks any build on MSVS 10 with present custom build step.
2) even if the code will be modified in the following way
script += newline_text;
script += "goto VCReportError";
script += newline_text;
script += ")";
}
if( we are generating project for MSVS 10 )
{
script += ":VCReportError";
script += "echo A custom buildtool returned error code";
}
return script;
a build still may be broken. For example, we are relying on error codes from our
tools and we are outputing customized error messages. So, adding "if errorlevel
1 goto VCReportError" after each command still will hurt us. But, of course,
this may be not a good style of using CMake so I'm open to new ideas.
Thanks in advance :-)
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2010-11-29 05:22 Alexander IvaniukNew Issue
======================================================================
More information about the cmake-developers
mailing list