summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-06-27 12:56:31 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-06-27 12:56:41 (GMT)
commit3327fe948ef61ec907b1d0c056d8933f65c18214 (patch)
tree952575463628c55ab0178f4cb161460b75362a2b /Source
parent50b2e74396fe09e928bf5d2b4c747257394aa138 (diff)
parentcd92f8f8bf9d3312f195ac5c27c129ff7868fa7e (diff)
downloadCMake-3327fe948ef61ec907b1d0c056d8933f65c18214.zip
CMake-3327fe948ef61ec907b1d0c056d8933f65c18214.tar.gz
CMake-3327fe948ef61ec907b1d0c056d8933f65c18214.tar.bz2
Merge topic 'vs-dpi-aware'
cd92f8f8bf VS: Add VS_DPI_AWARE target property Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3418
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx33
1 files changed, 25 insertions, 8 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ee16d4e..150ede7 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3253,15 +3253,32 @@ void cmVisualStudio10TargetGenerator::WriteManifestOptions(
std::vector<cmSourceFile const*> manifest_srcs;
this->GeneratorTarget->GetManifests(manifest_srcs, config);
- if (!manifest_srcs.empty()) {
- std::ostringstream oss;
- for (cmSourceFile const* mi : manifest_srcs) {
- std::string m = this->ConvertPath(mi->GetFullPath(), false);
- ConvertToWindowsSlash(m);
- oss << m << ";";
- }
+
+ const char* dpiAware = this->GeneratorTarget->GetProperty("VS_DPI_AWARE");
+
+ if (!manifest_srcs.empty() || dpiAware) {
Elem e2(e1, "Manifest");
- e2.Element("AdditionalManifestFiles", oss.str());
+ if (!manifest_srcs.empty()) {
+ std::ostringstream oss;
+ for (cmSourceFile const* mi : manifest_srcs) {
+ std::string m = this->ConvertPath(mi->GetFullPath(), false);
+ ConvertToWindowsSlash(m);
+ oss << m << ";";
+ }
+ e2.Element("AdditionalManifestFiles", oss.str());
+ }
+ if (dpiAware) {
+ if (!strcmp(dpiAware, "PerMonitor")) {
+ e2.Element("EnableDpiAwareness", "PerMonitorHighDPIAware");
+ } else if (cmSystemTools::IsOn(dpiAware)) {
+ e2.Element("EnableDpiAwareness", "true");
+ } else if (cmSystemTools::IsOff(dpiAware)) {
+ e2.Element("EnableDpiAwareness", "false");
+ } else {
+ cmSystemTools::Error("Bad parameter for VS_DPI_AWARE: " +
+ std::string(dpiAware));
+ }
+ }
}
}