diff options
author | Ken Martin <ken.martin@kitware.com> | 2003-06-21 00:33:43 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2003-06-21 00:33:43 (GMT) |
commit | aaf279505005a4604ae6317297e2e926fdf9bc78 (patch) | |
tree | 88db6546e5c58af05f96fca06a95e2bcdcbff7ca | |
parent | 653cb84f6687818740a6d80fa87880ca4654b06e (diff) | |
download | CMake-aaf279505005a4604ae6317297e2e926fdf9bc78.zip CMake-aaf279505005a4604ae6317297e2e926fdf9bc78.tar.gz CMake-aaf279505005a4604ae6317297e2e926fdf9bc78.tar.bz2 |
fix to expand variables in custom command outputs and main dependencies
-rw-r--r-- | Source/cmMakefile.cxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a5cd730..9246b89 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -477,6 +477,7 @@ void cmMakefile::AddCustomCommand(const char* source, // add the output to the target? std::string sname = *d; sname += ".rule"; + this->ExpandVariablesInString(sname); // if the rule was added to the source, // then add the source to the target if (!this->GetSource(sname.c_str())) @@ -533,14 +534,25 @@ AddCustomCommandToOutput(const char* output, combinedArgs += " "; } cmSourceFile *file = 0; + + // setup the output name and make sure we expand any variables std::string outName = output; outName += ".rule"; - + this->ExpandVariablesInString(outName); + + // setup the main dependency name and expand vars of course + std::string mainDepend; + if (main_dependency && main_dependency[0] != '\0') + { + mainDepend = main_dependency; + this->ExpandVariablesInString(mainDepend); + } + // OK this rule will be placed on a generated output file unless the main // depednency was specified. if (main_dependency && main_dependency[0] != '\0') { - file = this->GetSource(main_dependency); + file = this->GetSource(mainDepend.c_str()); if (file && file->GetCustomCommand() && !replace) { cmCustomCommand* cc = file->GetCustomCommand(); @@ -556,7 +568,7 @@ AddCustomCommandToOutput(const char* output, } else { - file = this->GetOrCreateSource(main_dependency); + file = this->GetOrCreateSource(mainDepend.c_str()); } } @@ -598,7 +610,7 @@ AddCustomCommandToOutput(const char* output, std::vector<std::string> depends2(depends); if (main_dependency && main_dependency[0] != '\0') { - depends2.push_back(main_dependency); + depends2.push_back(mainDepend.c_str()); } cmCustomCommand *cc = new cmCustomCommand(c.c_str(),combinedArgs.c_str(),depends2, output); |