mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-05 13:50:10 -05:00
ENH: fix subdir issue
This commit is contained in:
+13
-2
@@ -2062,10 +2062,21 @@ cmSourceFile* cmMakefile::GetSource(const char* sourceName) const
|
||||
{
|
||||
// if the source is provided with a full path use it, otherwise
|
||||
// by default it is in the current source dir
|
||||
std::string path = cmSystemTools::GetFilenamePath(sourceName);
|
||||
if (path.empty())
|
||||
std::string path;
|
||||
if (cmSystemTools::FileIsFullPath(sourceName))
|
||||
{
|
||||
path = cmSystemTools::GetFilenamePath(sourceName);
|
||||
}
|
||||
else
|
||||
{
|
||||
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 =
|
||||
|
||||
Reference in New Issue
Block a user