BUG: Fix Bug #445 - Same library in multiple projects can cause problems

This commit is contained in:
Andy Cedilnik 2003-12-18 13:17:36 -05:00
parent c3840b5cc3
commit 72d8bd1e41
7 changed files with 12 additions and 12 deletions

View File

@ -229,7 +229,7 @@ void cmGlobalCodeWarriorGenerator::ComputeTargetOrder(
std::string libPath = j->first + "_CMAKE_PATH"; std::string libPath = j->first + "_CMAKE_PATH";
const char* cacheValue const char* cacheValue
= m_CMakeInstance->GetCacheDefinition(libPath.c_str()); = m_CMakeInstance->GetCacheDefinition(libPath.c_str());
if(cacheValue) if(cacheValue && *cacheValue)
{ {
// so add it to the tgtOrder vector if it isn't already there // so add it to the tgtOrder vector if it isn't already there
// to do this we need the actual target // to do this we need the actual target

View File

@ -452,7 +452,7 @@ void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout,
std::string libPath = j->first + "_CMAKE_PATH"; std::string libPath = j->first + "_CMAKE_PATH";
const char* cacheValue const char* cacheValue
= m_CMakeInstance->GetCacheDefinition(libPath.c_str()); = m_CMakeInstance->GetCacheDefinition(libPath.c_str());
if(cacheValue) if(cacheValue && *cacheValue)
{ {
fout << "Begin Project Dependency\n"; fout << "Begin Project Dependency\n";
fout << "Project_Dep_Name " << j->first << "\n"; fout << "Project_Dep_Name " << j->first << "\n";

View File

@ -248,7 +248,7 @@ void cmGlobalVisualStudio71Generator::WriteProjectDepends(std::ostream& fout,
std::string libPath = j->first + "_CMAKE_PATH"; std::string libPath = j->first + "_CMAKE_PATH";
const char* cacheValue const char* cacheValue
= m_CMakeInstance->GetCacheDefinition(libPath.c_str()); = m_CMakeInstance->GetCacheDefinition(libPath.c_str());
if(cacheValue) if(cacheValue && *cacheValue)
{ {
fout << "\t\t{" << this->CreateGUID(j->first.c_str()) << "} = {" fout << "\t\t{" << this->CreateGUID(j->first.c_str()) << "} = {"
<< this->CreateGUID(j->first.c_str()) << "}\n"; << this->CreateGUID(j->first.c_str()) << "}\n";

View File

@ -534,7 +534,7 @@ void cmGlobalVisualStudio7Generator::WriteProjectDepends(std::ostream& fout,
std::string libPath = j->first + "_CMAKE_PATH"; std::string libPath = j->first + "_CMAKE_PATH";
const char* cacheValue const char* cacheValue
= m_CMakeInstance->GetCacheDefinition(libPath.c_str()); = m_CMakeInstance->GetCacheDefinition(libPath.c_str());
if(cacheValue) if(cacheValue && *cacheValue)
{ {
fout << "\t\t{" << this->CreateGUID(dspname) << "}." << depcount << " = {" fout << "\t\t{" << this->CreateGUID(dspname) << "}." << depcount << " = {"
<< this->CreateGUID(j->first.c_str()) << "}\n"; << this->CreateGUID(j->first.c_str()) << "}\n";

View File

@ -189,7 +189,7 @@ void cmLocalCodeWarriorGenerator::WriteSettingList(std::ostream& fout,
= GetGlobalGenerator()->GetCMakeInstance() = GetGlobalGenerator()->GetCMakeInstance()
->GetCacheDefinition(libPath.c_str()); ->GetCacheDefinition(libPath.c_str());
if( cacheValue ) if( cacheValue && *cacheValue )
{ {
// just tack it on // just tack it on
fout << "<SETTING>\n"; fout << "<SETTING>\n";
@ -585,7 +585,7 @@ void cmLocalCodeWarriorGenerator::WriteFileList(std::ostream& fout,
= GetGlobalGenerator()->GetCMakeInstance() = GetGlobalGenerator()->GetCMakeInstance()
->GetCacheDefinition(libPath.c_str()); ->GetCacheDefinition(libPath.c_str());
if( cacheValue ) if( cacheValue && *cacheValue )
{ {
// just tack it on // just tack it on
fout << "<FILE>\n"; fout << "<FILE>\n";
@ -718,7 +718,7 @@ void cmLocalCodeWarriorGenerator::WriteLinkOrder(std::ostream& fout,
= GetGlobalGenerator()->GetCMakeInstance() = GetGlobalGenerator()->GetCMakeInstance()
->GetCacheDefinition(libPath.c_str()); ->GetCacheDefinition(libPath.c_str());
if( cacheValue ) if( cacheValue && *cacheValue )
{ {
// just tack it on // just tack it on
fout << "<FILEREF>\n"; fout << "<FILEREF>\n";
@ -988,7 +988,7 @@ void cmLocalCodeWarriorGenerator::WriteGroup(std::ostream& fout,
= GetGlobalGenerator()->GetCMakeInstance() = GetGlobalGenerator()->GetCMakeInstance()
->GetCacheDefinition(libPath.c_str()); ->GetCacheDefinition(libPath.c_str());
if( cacheValue ) if( cacheValue && *cacheValue )
{ {
// this is a subtarget reference, it will be taken care of later // this is a subtarget reference, it will be taken care of later
continue; continue;

View File

@ -471,7 +471,7 @@ void cmLocalVisualStudio6Generator::WriteCustomRule(std::ostream& fout,
} }
std::string libPath = dep + "_CMAKE_PATH"; std::string libPath = dep + "_CMAKE_PATH";
const char* cacheValue = m_Makefile->GetDefinition(libPath.c_str()); const char* cacheValue = m_Makefile->GetDefinition(libPath.c_str());
if (cacheValue) if (cacheValue && *cacheValue)
{ {
std::string exePath = ""; std::string exePath = "";
if (m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH")) if (m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"))
@ -877,7 +877,7 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha
const char* cacheValue const char* cacheValue
= m_GlobalGenerator->GetCMakeInstance()->GetCacheDefinition( = m_GlobalGenerator->GetCMakeInstance()->GetCacheDefinition(
libPath.c_str()); libPath.c_str());
if ( cacheValue && m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX") ) if ( cacheValue && *cacheValue && m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX") )
{ {
libDebug += m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX"); libDebug += m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
} }

View File

@ -685,7 +685,7 @@ void cmLocalVisualStudio7Generator::OutputLibraries(std::ostream& fout,
std::string libPath = j->first + "_CMAKE_PATH"; std::string libPath = j->first + "_CMAKE_PATH";
const char* cacheValue const char* cacheValue
= m_GlobalGenerator->GetCMakeInstance()->GetCacheDefinition(libPath.c_str()); = m_GlobalGenerator->GetCMakeInstance()->GetCacheDefinition(libPath.c_str());
if(cacheValue && m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX")) if(cacheValue && *cacheValue && m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX"))
{ {
debugPostfix = m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX"); debugPostfix = m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
} }
@ -956,7 +956,7 @@ WriteCustomRule(std::ostream& fout,
} }
std::string libPath = dep + "_CMAKE_PATH"; std::string libPath = dep + "_CMAKE_PATH";
const char* cacheValue = m_Makefile->GetDefinition(libPath.c_str()); const char* cacheValue = m_Makefile->GetDefinition(libPath.c_str());
if (cacheValue) if (cacheValue && *cacheValue)
{ {
std::string exePath = ""; std::string exePath = "";
if (m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH")) if (m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"))