diff options
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 60 |
1 files changed, 27 insertions, 33 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index c40ca42..6e2f1be 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -124,16 +124,6 @@ void cmLocalVisualStudio7Generator::OutputVCProjFile() { this->AddVCProjBuildRule(l->second); } - - // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace - // so don't build a projectfile for it - if ((l->second.GetType() != cmTarget::INSTALL_FILES) - && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS) - && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)) - { - cmTarget& target = l->second; - target.TraceVSDependencies(target.GetName(), this->Makefile); - } } for(cmTargets::iterator l = tgts.begin(); @@ -623,7 +613,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, << "\t\t\t/>\n"; } - this->OutputTargetRules(fout, target, libName); + this->OutputTargetRules(fout, configName, target, libName); this->OutputBuildTool(fout, configName, target); fout << "\t\t</Configuration>\n"; } @@ -1141,17 +1131,8 @@ void cmLocalVisualStudio7Generator fout << "\t\t\t\tRelativePath=\"" << d << "\">\n"; if (command) { - // Construct the entire set of commands in one string. - std::string script = - this->ConstructScript(command->GetCommandLines(), - command->GetWorkingDirectory(), - command->GetEscapeOldStyle(), - command->GetEscapeAllowMakeVars()); - std::string comment = this->ConstructComment(*command); const char* flags = compileFlags.size() ? compileFlags.c_str(): 0; - this->WriteCustomRule(fout, source.c_str(), script.c_str(), - comment.c_str(), command->GetDepends(), - command->GetOutputs(), flags); + this->WriteCustomRule(fout, source.c_str(), *command, flags); } else if(compileFlags.size() || additionalDeps.length() || objectName.size() || excludedFromBuild) @@ -1228,12 +1209,11 @@ void cmLocalVisualStudio7Generator void cmLocalVisualStudio7Generator:: WriteCustomRule(std::ostream& fout, const char* source, - const char* command, - const char* comment, - const std::vector<std::string>& depends, - const std::vector<std::string>& outputs, + const cmCustomCommand& command, const char* compileFlags) { + std::string comment = this->ConstructComment(command); + // Write the rule for each configuration. std::vector<std::string>::iterator i; std::vector<std::string> *configs = @@ -1251,14 +1231,21 @@ WriteCustomRule(std::ostream& fout, << "\t\t\t\t\tAdditionalOptions=\"" << this->EscapeForXML(compileFlags) << "\"/>\n"; } + + std::string script = + this->ConstructScript(command.GetCommandLines(), + command.GetWorkingDirectory(), + i->c_str(), + command.GetEscapeOldStyle(), + command.GetEscapeAllowMakeVars()); fout << "\t\t\t\t\t<Tool\n" << "\t\t\t\t\tName=\"VCCustomBuildTool\"\n" << "\t\t\t\t\tDescription=\"" - << this->EscapeForXML(comment) << "\"\n" + << this->EscapeForXML(comment.c_str()) << "\"\n" << "\t\t\t\t\tCommandLine=\"" - << this->EscapeForXML(command) << "\"\n" + << this->EscapeForXML(script.c_str()) << "\"\n" << "\t\t\t\t\tAdditionalDependencies=\""; - if(depends.empty()) + if(command.GetDepends().empty()) { // There are no real dependencies. Produce an artificial one to // make sure the rule runs reliably. @@ -1272,8 +1259,10 @@ WriteCustomRule(std::ostream& fout, else { // Write out the dependencies for the rule. - for(std::vector<std::string>::const_iterator d = depends.begin(); - d != depends.end(); ++d) + for(std::vector<std::string>::const_iterator d = + command.GetDepends().begin(); + d != command.GetDepends().end(); + ++d) { // Get the real name of the dependency in case it is a CMake target. std::string dep = this->GetRealDependency(d->c_str(), i->c_str()); @@ -1283,7 +1272,7 @@ WriteCustomRule(std::ostream& fout, } fout << "\"\n"; fout << "\t\t\t\t\tOutputs=\""; - if(outputs.empty()) + if(command.GetOutputs().empty()) { fout << source << "_force"; } @@ -1291,8 +1280,9 @@ WriteCustomRule(std::ostream& fout, { // Write a rule for the output generated by this command. const char* sep = ""; - for(std::vector<std::string>::const_iterator o = outputs.begin(); - o != outputs.end(); ++o) + for(std::vector<std::string>::const_iterator o = command.GetOutputs().begin(); + o != command.GetOutputs().end(); + ++o) { fout << sep << this->ConvertToXMLOutputPathSingle(o->c_str()); sep = ";"; @@ -1323,6 +1313,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjEndGroup(std::ostream& fout) // look for custom rules on a target and collect them together void cmLocalVisualStudio7Generator ::OutputTargetRules(std::ostream& fout, + const char* configName, cmTarget &target, const char * /*libName*/) { @@ -1350,6 +1341,7 @@ void cmLocalVisualStudio7Generator std::string script = this->ConstructScript(cr->GetCommandLines(), cr->GetWorkingDirectory(), + configName, cr->GetEscapeOldStyle(), cr->GetEscapeAllowMakeVars()); fout << this->EscapeForXML(script.c_str()).c_str(); @@ -1379,6 +1371,7 @@ void cmLocalVisualStudio7Generator std::string script = this->ConstructScript(cr->GetCommandLines(), cr->GetWorkingDirectory(), + configName, cr->GetEscapeOldStyle(), cr->GetEscapeAllowMakeVars()); fout << this->EscapeForXML(script.c_str()).c_str(); @@ -1408,6 +1401,7 @@ void cmLocalVisualStudio7Generator std::string script = this->ConstructScript(cr->GetCommandLines(), cr->GetWorkingDirectory(), + configName, cr->GetEscapeOldStyle(), cr->GetEscapeAllowMakeVars()); fout << this->EscapeForXML(script.c_str()).c_str(); |