From b6121bf8a8146fef5ba29ab6c38749fa27904073 Mon Sep 17 00:00:00 2001 From: Berk Geveci Date: Wed, 27 Jun 2001 17:19:11 -0400 Subject: [PATCH] Added variable expansion. --- Source/cmSourceFilesCommand.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/cmSourceFilesCommand.cxx b/Source/cmSourceFilesCommand.cxx index 0d12c3daa..63ce45cbb 100644 --- a/Source/cmSourceFilesCommand.cxx +++ b/Source/cmSourceFilesCommand.cxx @@ -51,9 +51,21 @@ bool cmSourceFilesCommand::InitialPass(std::vector& args) for(std::vector::iterator i = (args.begin() + 1); i != args.end(); ++i) { + std::string copy = *i; + m_Makefile->ExpandVariablesInString(copy); cmSourceFile file; file.SetIsAnAbstractClass(false); - file.SetName((*i).c_str(), m_Makefile->GetCurrentDirectory()); + std::string path = cmSystemTools::GetFilenamePath(copy); + if (path == "") + { + file.SetName(cmSystemTools::GetFilenameName(copy.c_str()).c_str(), + m_Makefile->GetCurrentDirectory()); + } + else + { + file.SetName(cmSystemTools::GetFilenameName(copy.c_str()).c_str(), + path.c_str()); + } m_Makefile->AddSource(file, args[0].c_str()); } return true;