summaryrefslogtreecommitdiffstats
path: root/Source/cmFunctionCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2007-12-20 15:05:08 (GMT)
committerKen Martin <ken.martin@kitware.com>2007-12-20 15:05:08 (GMT)
commitf69a6a7c8ca61b71991b9ec38e04a4eb932f35b6 (patch)
tree1717f3223ce8033967ed6a12afdec82c05bd1bd1 /Source/cmFunctionCommand.cxx
parent4ca0d1ba098bfa3397603b7b73c2506041a0bb11 (diff)
downloadCMake-f69a6a7c8ca61b71991b9ec38e04a4eb932f35b6.zip
CMake-f69a6a7c8ca61b71991b9ec38e04a4eb932f35b6.tar.gz
CMake-f69a6a7c8ca61b71991b9ec38e04a4eb932f35b6.tar.bz2
BUG: fix issue with CMAKE_CURENT_LIST_FILE reporting in funcitons
Diffstat (limited to 'Source/cmFunctionCommand.cxx')
-rw-r--r--Source/cmFunctionCommand.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index ea6163a..5828cdd 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -150,8 +150,6 @@ bool cmFunctionHelperCommand::InvokeInitialPass
this->Makefile->AddDefinition("ARGN", argnDef.c_str());
// Invoke all the functions that were collected in the block.
- cmListFileFunction newLFF;
-
// for each function
for(unsigned int c = 0; c < this->Functions.size(); ++c)
{
@@ -203,6 +201,18 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
cmFunctionHelperCommand *f = new cmFunctionHelperCommand();
f->Args = this->Args;
f->Functions = this->Functions;
+
+ // Set the FilePath on the arguments to match the function since it is
+ // not stored and the original values may be freed
+ for (unsigned int i = 0; i < f->Functions.size(); ++i)
+ {
+ for (unsigned int j = 0; j < f->Functions[i].Arguments.size(); ++j)
+ {
+ f->Functions[i].Arguments[j].FilePath =
+ f->Functions[i].FilePath.c_str();
+ }
+ }
+
std::string newName = "_" + this->Args[0];
mf.GetCMakeInstance()->RenameCommand(this->Args[0].c_str(),
newName.c_str());