summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2006-06-26 15:27:21 (GMT)
committerKen Martin <ken.martin@kitware.com>2006-06-26 15:27:21 (GMT)
commitf16b03ec070b42684f44a2afe590e78937328869 (patch)
tree2bbde7f2ad0c2b0cfc1e1addee686bc35f0c5a52 /Source/cmMakefile.cxx
parent1307dfbd32d0079d320ca2f1d4d0d52216e09e1a (diff)
downloadCMake-f16b03ec070b42684f44a2afe590e78937328869.zip
CMake-f16b03ec070b42684f44a2afe590e78937328869.tar.gz
CMake-f16b03ec070b42684f44a2afe590e78937328869.tar.bz2
ENH: fix subdir issue
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5251b4d..ff35cf8 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -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 =