diff options
author | Brad King <brad.king@kitware.com> | 2011-04-08 14:40:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-04-08 19:36:16 (GMT) |
commit | 06fcbc4757c7a52733a554d4050735452d49a5e7 (patch) | |
tree | ec735575eb956a5a5ea873b87e0e43ea6c73168d /Source/cmLocalVisualStudio10Generator.cxx | |
parent | a961ecdad0ec31bacb3f6abff83aa65f0b51a676 (diff) | |
download | CMake-06fcbc4757c7a52733a554d4050735452d49a5e7.zip CMake-06fcbc4757c7a52733a554d4050735452d49a5e7.tar.gz CMake-06fcbc4757c7a52733a554d4050735452d49a5e7.tar.bz2 |
VS10: Fix working directory of consecutive custom commands (#11938)
The VS 10 msbuild tool uses a single command shell to invoke all the
custom command scripts in a project. Isolate the environment and
working directory of custom commands using setlocal/endlocal. The
form of each command is
set errlev=
setlocal
cd c:\work\dir
if %errorlevel% neq 0 goto :cmEnd
c:
if %errorlevel% neq 0 goto :cmEnd
command1 ...
if %errorlevel% neq 0 goto :cmEnd
...
commandN ...
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & set errlev=%errorlevel%
if %errlev% neq 0 goto :VCEnd
so that all changes to the environment and working directory are
isolated within the script and the return code is preserved.
Diffstat (limited to 'Source/cmLocalVisualStudio10Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio10Generator.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index de2a837..1850c16 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -119,7 +119,7 @@ void cmLocalVisualStudio10Generator } //---------------------------------------------------------------------------- -std::string cmLocalVisualStudio10Generator::CheckForErrorLine() +const char* cmLocalVisualStudio10Generator::ReportErrorLabel() const { - return "if errorlevel 1 goto :VCEnd"; + return ":VCEnd"; } |