BUG#65: Fixed inheritance of CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR.

This commit is contained in:
Brad King 2003-07-08 13:27:34 -04:00
parent b274069b93
commit 1a4ec91593
1 changed files with 8 additions and 6 deletions

View File

@ -308,13 +308,15 @@ bool cmMakefile::ReadListFile(const char* filename_in, const char* external_in)
std::string parentList = this->GetParentListFileName(filename);
if (parentList != "")
{
std::string srcdir = m_cmCurrentDirectory;
std::string bindir = m_CurrentOutputDirectory;
std::string srcdir = this->GetCurrentDirectory();
std::string bindir = this->GetCurrentOutputDirectory();
std::string::size_type pos = parentList.rfind('/');
m_cmCurrentDirectory = parentList.substr(0, pos);
m_CurrentOutputDirectory = m_HomeOutputDirectory + parentList.substr(m_cmHomeDirectory.size(), pos - m_cmHomeDirectory.size());
this->SetCurrentDirectory(parentList.substr(0, pos).c_str());
this->SetCurrentOutputDirectory((m_HomeOutputDirectory +
parentList.substr(m_cmHomeDirectory.size(),
pos - m_cmHomeDirectory.size())).c_str());
// if not found, oops
if(pos == std::string::npos)
@ -325,8 +327,8 @@ bool cmMakefile::ReadListFile(const char* filename_in, const char* external_in)
this->ReadListFile(parentList.c_str());
// restore the current directory
m_cmCurrentDirectory = srcdir;
m_CurrentOutputDirectory = bindir;
this->SetCurrentDirectory(srcdir.c_str());
this->SetCurrentOutputDirectory(bindir.c_str());
}
}