summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-04-25 17:09:17 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-04-25 17:09:17 (GMT)
commit059a14a3a60b97000345de9057e6dd9b3627e617 (patch)
treef7b68ca92fc90c2963d5e6b1586619d98718b705 /Source/cmake.cxx
parent945c4a8b5b2e0650478f6bc67029d9481207702d (diff)
downloadCMake-059a14a3a60b97000345de9057e6dd9b3627e617.zip
CMake-059a14a3a60b97000345de9057e6dd9b3627e617.tar.gz
CMake-059a14a3a60b97000345de9057e6dd9b3627e617.tar.bz2
ENH: check for mismatched generators
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index b512d92..47f204c 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -408,6 +408,22 @@ int cmake::Generate(const std::vector<std::string>& args, bool buildMakefiles)
}
cmMakefileGenerator* gen = mf.GetMakefileGenerator();
gen->SetLocal(m_Local);
+ const char* genName = mf.GetDefinition("CMAKE_GENERATOR");
+ if(genName)
+ {
+ if(strcmp(gen->GetName(), genName) != 0)
+ {
+ std::string message = "Error: generator : ";
+ message += gen->GetName();
+ message += "\nDoes not match the generator used previously: ";
+ message += genName;
+ message +=
+ "\nEither remove the CMakeCache.txt file or choose a different"
+ " binary directory.";
+ cmSystemTools::Error(message.c_str());
+ return -2;
+ }
+ }
if(!mf.GetDefinition("CMAKE_GENERATOR"))
{
mf.AddCacheDefinition("CMAKE_GENERATOR",