diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2005-04-05 14:22:18 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2005-04-05 14:22:18 (GMT) |
commit | 0255dab023023e64a27eda035634fea023cab0bc (patch) | |
tree | dea2ed53f48c1a2a37cabd3bbbf862cc4895fde8 | |
parent | 389f24f777b790b12759184c96c4690a771f941b (diff) | |
download | CMake-0255dab023023e64a27eda035634fea023cab0bc.zip CMake-0255dab023023e64a27eda035634fea023cab0bc.tar.gz CMake-0255dab023023e64a27eda035634fea023cab0bc.tar.bz2 |
BUG: fix for bug 1702, better error message for GUID missing
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.cxx | 13 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 40 |
2 files changed, 46 insertions, 7 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index e5583c1..0716773 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -295,8 +295,17 @@ void cmGlobalVisualStudio71Generator::WriteProjectDepends(std::ostream& fout, // target names anyways. name.erase(name.begin(), name.begin() + 27); } - fout << "\t\t{" << this->GetGUID(name.c_str()) << "} = {" - << this->GetGUID(name.c_str()) << "}\n"; + std::string guid = this->GetGUID(name.c_str()); + if(guid.size() == 0) + { + std::string m = "Target: "; + m += target.GetName(); + m += " depends on unknown target: "; + m += name; + cmSystemTools::Error(m.c_str()); + } + + fout << "\t\t{" << guid << "} = {" << guid << "}\n"; } } } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index ef2faf8..7172d7c 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -435,8 +435,18 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout, int depcount = 0; for(iter = depends.begin(); iter != depends.end(); ++iter) { + std::string guid = this->GetGUID(iter->c_str()); + if(guid.size() == 0) + { + std::string m = "Target: "; + m += l->first; + m += " depends on unknown target: "; + m += iter->c_str(); + cmSystemTools::Error(m.c_str()); + } + fout << "\t\t{" << this->GetGUID(name.c_str()) << "}." << depcount << " = {" - << this->GetGUID(iter->c_str()) << "}\n"; + << guid.c_str() << "}\n"; depcount++; } } @@ -532,8 +542,18 @@ void cmGlobalVisualStudio7Generator::WriteProjectDepends(std::ostream& fout, = m_CMakeInstance->GetCacheDefinition(libPath.c_str()); if(cacheValue && *cacheValue) { + std::string guid = this->GetGUID(j->first.c_str()); + if(guid.size() == 0) + { + std::string m = "Target: "; + m += dspname; + m += " depends on unknown target: "; + m += j->first.c_str(); + cmSystemTools::Error(m.c_str()); + } + fout << "\t\t{" << this->GetGUID(dspname) << "}." << depcount << " = {" - << this->GetGUID(j->first.c_str()) << "}\n"; + << guid << "}\n"; depcount++; } } @@ -559,8 +579,18 @@ void cmGlobalVisualStudio7Generator::WriteProjectDepends(std::ostream& fout, // target names anyways. name.erase(name.begin(), name.begin() + 27); } + std::string guid = this->GetGUID(name.c_str()); + if(guid.size() == 0) + { + std::string m = "Target: "; + m += dspname; + m += " depends on unknown target: "; + m += name.c_str(); + cmSystemTools::Error(m.c_str()); + } + fout << "\t\t{" << this->GetGUID(dspname) << "}." << depcount << " = {" - << this->GetGUID(name.c_str()) << "}\n"; + << guid << "}\n"; depcount++; } } @@ -634,9 +664,9 @@ std::string cmGlobalVisualStudio7Generator::GetGUID(const char* name) { return std::string(storedGUID); } - cmSystemTools::Error("Internal CMake Error, Could not find GUID for target: ", + cmSystemTools::Error("Unknown Target referenced : ", name); - return guidStoreName; + return ""; } |