ENH: fix subdir issue
This commit is contained in:
parent
1307dfbd32
commit
f16b03ec07
|
@ -2062,10 +2062,21 @@ cmSourceFile* cmMakefile::GetSource(const char* sourceName) const
|
||||||
{
|
{
|
||||||
// if the source is provided with a full path use it, otherwise
|
// if the source is provided with a full path use it, otherwise
|
||||||
// by default it is in the current source dir
|
// by default it is in the current source dir
|
||||||
std::string path = cmSystemTools::GetFilenamePath(sourceName);
|
std::string path;
|
||||||
if (path.empty())
|
if (cmSystemTools::FileIsFullPath(sourceName))
|
||||||
|
{
|
||||||
|
path = cmSystemTools::GetFilenamePath(sourceName);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
path = this->GetCurrentDirectory();
|
path = this->GetCurrentDirectory();
|
||||||
|
// even though it is not a full path, it may still be relative
|
||||||
|
std::string subpath = cmSystemTools::GetFilenamePath(sourceName);
|
||||||
|
if (!subpath.empty())
|
||||||
|
{
|
||||||
|
path += "/";
|
||||||
|
path += cmSystemTools::GetFilenamePath(sourceName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string sname =
|
std::string sname =
|
||||||
|
|
Loading…
Reference in New Issue