diff options
author | Brad King <brad.king@kitware.com> | 2023-02-17 13:53:04 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-02-17 13:53:12 (GMT) |
commit | e4de6069834d3e7fcb39e8eec6fafcc4190dbf6d (patch) | |
tree | 421fc92281946598f7a9b14d3ea600b4120184e1 | |
parent | ab049ed7f1efef546ef82d1ec2585a03b47eccce (diff) | |
parent | 74e0b5d9f5006f9344856428a27c6cfb47591df0 (diff) | |
download | CMake-e4de6069834d3e7fcb39e8eec6fafcc4190dbf6d.zip CMake-e4de6069834d3e7fcb39e8eec6fafcc4190dbf6d.tar.gz CMake-e4de6069834d3e7fcb39e8eec6fafcc4190dbf6d.tar.bz2 |
Merge topic 'sergio-nsk/24416/1'
74e0b5d9f5 VS: Fix wrong appxManifest if OUTPUT_NAME != target name
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8216
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 26 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.h | 1 |
2 files changed, 17 insertions, 10 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index c88679c..ae0d255 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -3108,6 +3108,17 @@ std::vector<std::string> cmVisualStudio10TargetGenerator::GetIncludes( return includes; } +std::string cmVisualStudio10TargetGenerator::GetTargetOutputName() const +{ + std::string config; + if (!this->Configurations.empty()) { + config = this->Configurations[0]; + } + const auto& nameComponents = + this->GeneratorTarget->GetFullNameComponents(config); + return nameComponents.prefix + nameComponents.base; +} + bool cmVisualStudio10TargetGenerator::ComputeClOptions() { return std::all_of( @@ -5057,8 +5068,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80(Elem& e1) this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); ConvertToWindowsSlash(artifactDir); std::string artifactDirXML = cmVS10EscapeXML(artifactDir); - std::string targetNameXML = - cmVS10EscapeXML(this->GeneratorTarget->GetName()); + const std::string& targetNameXML = cmVS10EscapeXML(GetTargetOutputName()); cmGeneratedFileStream fout(manifestFile); fout.SetCopyIfDifferent(true); @@ -5140,8 +5150,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP81(Elem& e1) this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); ConvertToWindowsSlash(artifactDir); std::string artifactDirXML = cmVS10EscapeXML(artifactDir); - std::string targetNameXML = - cmVS10EscapeXML(this->GeneratorTarget->GetName()); + const std::string& targetNameXML = cmVS10EscapeXML(GetTargetOutputName()); cmGeneratedFileStream fout(manifestFile); fout.SetCopyIfDifferent(true); @@ -5203,8 +5212,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWS80(Elem& e1) this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); ConvertToWindowsSlash(artifactDir); std::string artifactDirXML = cmVS10EscapeXML(artifactDir); - std::string targetNameXML = - cmVS10EscapeXML(this->GeneratorTarget->GetName()); + const std::string& targetNameXML = cmVS10EscapeXML(GetTargetOutputName()); cmGeneratedFileStream fout(manifestFile); fout.SetCopyIfDifferent(true); @@ -5258,8 +5266,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWS81(Elem& e1) this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); ConvertToWindowsSlash(artifactDir); std::string artifactDirXML = cmVS10EscapeXML(artifactDir); - std::string targetNameXML = - cmVS10EscapeXML(this->GeneratorTarget->GetName()); + const std::string& targetNameXML = cmVS10EscapeXML(GetTargetOutputName()); cmGeneratedFileStream fout(manifestFile); fout.SetCopyIfDifferent(true); @@ -5318,8 +5325,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWS10_0(Elem& e1) this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); ConvertToWindowsSlash(artifactDir); std::string artifactDirXML = cmVS10EscapeXML(artifactDir); - std::string targetNameXML = - cmVS10EscapeXML(this->GeneratorTarget->GetName()); + const std::string& targetNameXML = cmVS10EscapeXML(GetTargetOutputName()); cmGeneratedFileStream fout(manifestFile); fout.SetCopyIfDifferent(true); diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index e00f692..97ae69f 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -117,6 +117,7 @@ private: std::vector<std::string> GetIncludes(std::string const& config, std::string const& lang) const; + std::string GetTargetOutputName() const; bool ComputeClOptions(); bool ComputeClOptions(std::string const& configName); |