diff options
author | Matt Weir <mattweir73@gmail.com> | 2019-06-16 00:27:13 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-06-26 13:55:49 (GMT) |
commit | cd92f8f8bf9d3312f195ac5c27c129ff7868fa7e (patch) | |
tree | bc5baa382c6b204250799e5f0682a83701272bba /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 6f7b68e7f969ae39622492b27a6f4bbb79d25117 (diff) | |
download | CMake-cd92f8f8bf9d3312f195ac5c27c129ff7868fa7e.zip CMake-cd92f8f8bf9d3312f195ac5c27c129ff7868fa7e.tar.gz CMake-cd92f8f8bf9d3312f195ac5c27c129ff7868fa7e.tar.bz2 |
VS: Add VS_DPI_AWARE target property
Enables setting the visual studio project property for Manifests,
controlling the DPI Aware setting.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 634c990..85feacd 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -3252,15 +3252,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)); + } + } } } |