summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-11-19 18:45:16 (GMT)
committerBrad King <brad.king@kitware.com>2007-11-19 18:45:16 (GMT)
commit3b59c7b97a1845fa16abee6ce130fa189cc9be13 (patch)
treec17ea3e28edbd74c3adadbb3b2ad36ba9d135c32 /Source
parent9f864879b4869cefea70099414634c0aed2eb547 (diff)
downloadCMake-3b59c7b97a1845fa16abee6ce130fa189cc9be13.zip
CMake-3b59c7b97a1845fa16abee6ce130fa189cc9be13.tar.gz
CMake-3b59c7b97a1845fa16abee6ce130fa189cc9be13.tar.bz2
ENH: Added call to StopBuild VS macro when projects fail to regenerate during a build.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmake.cxx18
-rw-r--r--Source/cmake.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index bec904d..e85b94a 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -530,6 +530,10 @@ void cmake::SetArgs(const std::vector<std::string>& args)
{
this->CheckStampFile = args[++i];
}
+ else if((i < args.size()-1) && (arg.find("--vs-solution-file",0) == 0))
+ {
+ this->VSSolutionFile = args[++i];
+ }
else if(arg.find("-V",0) == 0)
{
this->Verbose = true;
@@ -2099,6 +2103,20 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
int ret = this->Configure();
if (ret || this->ScriptMode)
{
+ if(!this->VSSolutionFile.empty() && this->GlobalGenerator)
+ {
+ // CMake is running to regenerate a Visual Studio build tree
+ // during a build from the VS IDE. The build files cannot be
+ // regenerated, so we should stop the build.
+ cmSystemTools::Message(
+ "CMake Configure step failed. "
+ "Build files cannot be regenerated correctly. "
+ "Attempting to stop IDE build.");
+ cmGlobalVisualStudioGenerator* gg =
+ static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator);
+ gg->CallVisualStudioMacro(cmGlobalVisualStudioGenerator::MacroStop,
+ this->VSSolutionFile.c_str());
+ }
return ret;
}
ret = this->Generate();
diff --git a/Source/cmake.h b/Source/cmake.h
index aa0ff28..feb154d 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -402,6 +402,7 @@ private:
std::string CCEnvironment;
std::string CheckBuildSystemArgument;
std::string CheckStampFile;
+ std::string VSSolutionFile;
std::string CTestCommand;
std::string CPackCommand;
bool ClearBuildSystem;