mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-30 02:59:22 -05:00
VS: Add VS_DPI_AWARE target property
Enables setting the visual studio project property for Manifests, controlling the DPI Aware setting.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user