diff options
author | Brad King <brad.king@kitware.com> | 2003-06-13 20:59:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2003-06-13 20:59:42 (GMT) |
commit | a5d930a686b74fc6d2621d0a03c745bc534282e8 (patch) | |
tree | c959d3f8d18daf354a48cf5aadab44fdac5330e9 /Source/cmMakefile.cxx | |
parent | dc87f60ca22ef2296655816d674874948ec8c7c1 (diff) | |
download | CMake-a5d930a686b74fc6d2621d0a03c745bc534282e8.zip CMake-a5d930a686b74fc6d2621d0a03c745bc534282e8.tar.gz CMake-a5d930a686b74fc6d2621d0a03c745bc534282e8.tar.bz2 |
BUG: Fixed translation of relative path names to full path names.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b4db084..f4d7a38 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); |