From a5d930a686b74fc6d2621d0a03c745bc534282e8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 13 Jun 2003 16:59:42 -0400 Subject: [PATCH] BUG: Fixed translation of relative path names to full path names. --- Source/cmMakefile.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b4db084c1..f4d7a3867 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1708,13 +1708,13 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const char* sourceName, bool generated) { // make it a full path first - std::string path = cmSystemTools::GetFilenamePath(sourceName); std::string src = sourceName; - if (path.empty()) + bool relative = !cmSystemTools::FileIsFullPath(sourceName); + if(relative) { src = this->GetCurrentDirectory(); src += "/"; - src += cmSystemTools::GetFilenameName(sourceName); + src += sourceName; } // check to see if it exists @@ -1726,11 +1726,11 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const char* sourceName, // OK a source file object doesn't exist for the source // maybe we made a bad call on assuming it was in the src tree - if (generated && path.empty()) + if (generated && relative) { src = this->GetCurrentOutputDirectory(); src += "/"; - src += cmSystemTools::GetFilenameName(sourceName); + src += sourceName; } ret = this->GetSource(src.c_str()); if (ret) @@ -1740,7 +1740,7 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const char* sourceName, // we must create one cmSourceFile file; - path = cmSystemTools::GetFilenamePath(src); + std::string path = cmSystemTools::GetFilenamePath(src); if(generated) { std::string ext = cmSystemTools::GetFilenameLastExtension(src);