BUG#65: Fixed inheritance of CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR.
This commit is contained in:
parent
b274069b93
commit
1a4ec91593
|
@ -308,13 +308,15 @@ bool cmMakefile::ReadListFile(const char* filename_in, const char* external_in)
|
||||||
std::string parentList = this->GetParentListFileName(filename);
|
std::string parentList = this->GetParentListFileName(filename);
|
||||||
if (parentList != "")
|
if (parentList != "")
|
||||||
{
|
{
|
||||||
std::string srcdir = m_cmCurrentDirectory;
|
std::string srcdir = this->GetCurrentDirectory();
|
||||||
std::string bindir = m_CurrentOutputDirectory;
|
std::string bindir = this->GetCurrentOutputDirectory();
|
||||||
|
|
||||||
std::string::size_type pos = parentList.rfind('/');
|
std::string::size_type pos = parentList.rfind('/');
|
||||||
|
|
||||||
m_cmCurrentDirectory = parentList.substr(0, pos);
|
this->SetCurrentDirectory(parentList.substr(0, pos).c_str());
|
||||||
m_CurrentOutputDirectory = m_HomeOutputDirectory + parentList.substr(m_cmHomeDirectory.size(), pos - m_cmHomeDirectory.size());
|
this->SetCurrentOutputDirectory((m_HomeOutputDirectory +
|
||||||
|
parentList.substr(m_cmHomeDirectory.size(),
|
||||||
|
pos - m_cmHomeDirectory.size())).c_str());
|
||||||
|
|
||||||
// if not found, oops
|
// if not found, oops
|
||||||
if(pos == std::string::npos)
|
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());
|
this->ReadListFile(parentList.c_str());
|
||||||
|
|
||||||
// restore the current directory
|
// restore the current directory
|
||||||
m_cmCurrentDirectory = srcdir;
|
this->SetCurrentDirectory(srcdir.c_str());
|
||||||
m_CurrentOutputDirectory = bindir;
|
this->SetCurrentOutputDirectory(bindir.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue