summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx57
1 files changed, 28 insertions, 29 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index ea31417..28037c6 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -125,9 +125,9 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
const std::string& propName, cmGeneratorTarget* target,
ImportPropertyMap& properties)
{
- const char* input = target->GetProperty(propName);
+ cmProp input = target->GetProperty(propName);
if (input) {
- properties[propName] = input;
+ properties[propName] = *input;
}
}
@@ -137,16 +137,16 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
cmGeneratorExpression::PreprocessContext preprocessRule,
ImportPropertyMap& properties, std::vector<std::string>& missingTargets)
{
- const char* input = target->GetProperty(propName);
+ cmProp input = target->GetProperty(propName);
if (input) {
- if (!*input) {
+ if (input->empty()) {
// Set to empty
properties[outputName].clear();
return;
}
std::string prepro =
- cmGeneratorExpression::Preprocess(input, preprocessRule);
+ cmGeneratorExpression::Preprocess(*input, preprocessRule);
if (!prepro.empty()) {
this->ResolveTargetsInGeneratorExpressions(prepro, target,
missingTargets);
@@ -174,10 +174,10 @@ bool cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty(
if (!target->IsLinkable()) {
return false;
}
- const char* input = target->GetProperty("INTERFACE_LINK_LIBRARIES");
+ cmProp input = target->GetProperty("INTERFACE_LINK_LIBRARIES");
if (input) {
std::string prepro =
- cmGeneratorExpression::Preprocess(input, preprocessRule);
+ cmGeneratorExpression::Preprocess(*input, preprocessRule);
if (!prepro.empty()) {
this->ResolveTargetsInGeneratorExpressions(
prepro, target, missingTargets, ReplaceFreeTargets);
@@ -341,19 +341,19 @@ void cmExportFileGenerator::PopulateSourcesInterface(
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
const char* propName = "INTERFACE_SOURCES";
- const char* input = gt->GetProperty(propName);
+ cmProp input = gt->GetProperty(propName);
if (!input) {
return;
}
- if (!*input) {
+ if (input->empty()) {
properties[propName].clear();
return;
}
std::string prepro =
- cmGeneratorExpression::Preprocess(input, preprocessRule, true);
+ cmGeneratorExpression::Preprocess(*input, preprocessRule, true);
if (!prepro.empty()) {
this->ResolveTargetsInGeneratorExpressions(prepro, gt, missingTargets);
@@ -372,7 +372,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
const char* propName = "INTERFACE_INCLUDE_DIRECTORIES";
- const char* input = target->GetProperty(propName);
+ cmProp input = target->GetProperty(propName);
cmGeneratorExpression ge;
@@ -399,7 +399,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
if (!input && exportDirs.empty()) {
return;
}
- if ((input && !*input) && exportDirs.empty()) {
+ if ((input && input->empty()) && exportDirs.empty()) {
// Set to empty
properties[propName].clear();
return;
@@ -407,7 +407,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
prefixItems(exportDirs);
- std::string includes = (input ? input : "");
+ std::string includes = (input ? *input : "");
const char* sep = input ? ";" : "";
includes += sep + exportDirs;
std::string prepro =
@@ -430,19 +430,19 @@ void cmExportFileGenerator::PopulateLinkDependsInterface(
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
const char* propName = "INTERFACE_LINK_DEPENDS";
- const char* input = gt->GetProperty(propName);
+ cmProp input = gt->GetProperty(propName);
if (!input) {
return;
}
- if (!*input) {
+ if (input->empty()) {
properties[propName].clear();
return;
}
std::string prepro =
- cmGeneratorExpression::Preprocess(input, preprocessRule, true);
+ cmGeneratorExpression::Preprocess(*input, preprocessRule, true);
if (!prepro.empty()) {
this->ResolveTargetsInGeneratorExpressions(prepro, gt, missingTargets);
@@ -461,19 +461,19 @@ void cmExportFileGenerator::PopulateLinkDirectoriesInterface(
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
const char* propName = "INTERFACE_LINK_DIRECTORIES";
- const char* input = gt->GetProperty(propName);
+ cmProp input = gt->GetProperty(propName);
if (!input) {
return;
}
- if (!*input) {
+ if (input->empty()) {
properties[propName].clear();
return;
}
std::string prepro =
- cmGeneratorExpression::Preprocess(input, preprocessRule, true);
+ cmGeneratorExpression::Preprocess(*input, preprocessRule, true);
if (!prepro.empty()) {
this->ResolveTargetsInGeneratorExpressions(prepro, gt, missingTargets);
@@ -496,11 +496,11 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
void getPropertyContents(cmGeneratorTarget const* tgt, const std::string& prop,
std::set<std::string>& ifaceProperties)
{
- const char* p = tgt->GetProperty(prop);
+ cmProp p = tgt->GetProperty(prop);
if (!p) {
return;
}
- std::vector<std::string> content = cmExpandedList(p);
+ std::vector<std::string> content = cmExpandedList(*p);
ifaceProperties.insert(content.begin(), content.end());
}
@@ -761,13 +761,12 @@ void cmExportFileGenerator::SetImportLinkInterface(
return;
}
- const char* propContent;
+ cmProp propContent;
- if (const char* prop_suffixed =
+ if (cmProp prop_suffixed =
target->GetProperty("LINK_INTERFACE_LIBRARIES" + suffix)) {
propContent = prop_suffixed;
- } else if (const char* prop =
- target->GetProperty("LINK_INTERFACE_LIBRARIES")) {
+ } else if (cmProp prop = target->GetProperty("LINK_INTERFACE_LIBRARIES")) {
propContent = prop;
} else {
return;
@@ -789,13 +788,13 @@ void cmExportFileGenerator::SetImportLinkInterface(
return;
}
- if (!*propContent) {
+ if (propContent->empty()) {
properties["IMPORTED_LINK_INTERFACE_LIBRARIES" + suffix].clear();
return;
}
std::string prepro =
- cmGeneratorExpression::Preprocess(propContent, preprocessRule);
+ cmGeneratorExpression::Preprocess(*propContent, preprocessRule);
if (!prepro.empty()) {
this->ResolveTargetsInGeneratorExpressions(prepro, target, missingTargets,
ReplaceFreeTargets);
@@ -855,8 +854,8 @@ void cmExportFileGenerator::SetImportDetailProperties(
cmGeneratorTarget::ManagedType::Native) {
std::string prop = cmStrCat("IMPORTED_COMMON_LANGUAGE_RUNTIME", suffix);
std::string propval;
- if (auto* p = target->GetProperty("COMMON_LANGUAGE_RUNTIME")) {
- propval = p;
+ if (cmProp p = target->GetProperty("COMMON_LANGUAGE_RUNTIME")) {
+ propval = *p;
} else if (target->IsCSharpOnly()) {
// C# projects do not have the /clr flag, so we set the property
// here to mark the target as (only) managed (i.e. no .lib file