summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceFilesCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSourceFilesCommand.cxx')
-rw-r--r--Source/cmSourceFilesCommand.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmSourceFilesCommand.cxx b/Source/cmSourceFilesCommand.cxx
index 63ce45c..bc39fc5 100644
--- a/Source/cmSourceFilesCommand.cxx
+++ b/Source/cmSourceFilesCommand.cxx
@@ -56,15 +56,16 @@ bool cmSourceFilesCommand::InitialPass(std::vector<std::string>& args)
cmSourceFile file;
file.SetIsAnAbstractClass(false);
std::string path = cmSystemTools::GetFilenamePath(copy);
- if (path == "")
+ // if this is a full path then
+ if((path.size() && path[0] == '/') ||
+ (path.size() > 1 && path[1] == ':'))
{
file.SetName(cmSystemTools::GetFilenameName(copy.c_str()).c_str(),
- m_Makefile->GetCurrentDirectory());
+ path.c_str());
}
else
{
- file.SetName(cmSystemTools::GetFilenameName(copy.c_str()).c_str(),
- path.c_str());
+ file.SetName(i->c_str(), m_Makefile->GetCurrentDirectory());
}
m_Makefile->AddSource(file, args[0].c_str());
}