cmGeneratorTarget::GetProperty: return cmProp

This commit is contained in:
Vitaly Stakhovsky
2020-04-29 11:00:00 -04:00
parent d63c442a6b
commit 36aba01223
32 changed files with 644 additions and 649 deletions
+13 -12
View File
@@ -342,19 +342,19 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
}
const char* expath = target->GetProperty("EXTERNAL_MSPROJECT");
cmProp expath = target->GetProperty("EXTERNAL_MSPROJECT");
if (expath) {
std::set<std::string> allConfigurations(configs.begin(), configs.end());
const char* mapping = target->GetProperty("VS_PLATFORM_MAPPING");
cmProp mapping = target->GetProperty("VS_PLATFORM_MAPPING");
this->WriteProjectConfigurations(fout, target->GetName(), *target,
configs, allConfigurations,
mapping ? mapping : "");
mapping ? *mapping : "");
} else {
const std::set<std::string>& configsPartOfDefaultBuild =
this->IsPartOfDefaultBuild(configs, projectTargets, target);
const char* vcprojName = target->GetProperty("GENERATOR_FILE_NAME");
cmProp vcprojName = target->GetProperty("GENERATOR_FILE_NAME");
if (vcprojName) {
this->WriteProjectConfigurations(fout, vcprojName, *target, configs,
this->WriteProjectConfigurations(fout, *vcprojName, *target, configs,
configsPartOfDefaultBuild);
}
}
@@ -375,17 +375,18 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
bool written = false;
// handle external vc project files
const char* expath = target->GetProperty("EXTERNAL_MSPROJECT");
cmProp expath = target->GetProperty("EXTERNAL_MSPROJECT");
if (expath) {
std::string project = target->GetName();
std::string location = expath;
std::string location = *expath;
cmProp p = target->GetProperty("VS_PROJECT_TYPE");
this->WriteExternalProject(fout, project, location,
target->GetProperty("VS_PROJECT_TYPE"),
p ? p->c_str() : nullptr,
target->GetUtilities());
written = true;
} else {
const char* vcprojName = target->GetProperty("GENERATOR_FILE_NAME");
cmProp vcprojName = target->GetProperty("GENERATOR_FILE_NAME");
if (vcprojName) {
cmLocalGenerator* lg = target->GetLocalGenerator();
std::string dir = lg->GetCurrentBinaryDirectory();
@@ -393,7 +394,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
if (dir == ".") {
dir.clear(); // msbuild cannot handle ".\" prefix
}
this->WriteProject(fout, vcprojName, dir, target);
this->WriteProject(fout, *vcprojName, dir, target);
written = true;
}
}
@@ -438,11 +439,11 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends(
if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
}
const char* vcprojName = target->GetProperty("GENERATOR_FILE_NAME");
cmProp vcprojName = target->GetProperty("GENERATOR_FILE_NAME");
if (vcprojName) {
std::string dir =
target->GetLocalGenerator()->GetCurrentSourceDirectory();
this->WriteProjectDepends(fout, vcprojName, dir.c_str(), target);
this->WriteProjectDepends(fout, *vcprojName, dir, target);
}
}
}