summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetPropertyComputer.h
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-03-16 17:45:00 (GMT)
committerVitaly Stakhovsky <vvs31415@gitlab.org>2020-03-16 17:47:05 (GMT)
commitfad0ee54041bf05f0d22b78e111b03eb368a213c (patch)
treec4dfc14f8929a9ec417da850f4b7d5c4e3c27265 /Source/cmTargetPropertyComputer.h
parent6f4b1ba96d724cbbc1642a7beb6ae9ec2b51d3bc (diff)
downloadCMake-fad0ee54041bf05f0d22b78e111b03eb368a213c.zip
CMake-fad0ee54041bf05f0d22b78e111b03eb368a213c.tar.gz
CMake-fad0ee54041bf05f0d22b78e111b03eb368a213c.tar.bz2
cmTargetPropertyComputer::GetProperty: return cmProp
Diffstat (limited to 'Source/cmTargetPropertyComputer.h')
-rw-r--r--Source/cmTargetPropertyComputer.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/Source/cmTargetPropertyComputer.h b/Source/cmTargetPropertyComputer.h
index df34f18..5387e00 100644
--- a/Source/cmTargetPropertyComputer.h
+++ b/Source/cmTargetPropertyComputer.h
@@ -14,15 +14,17 @@
class cmMessenger;
+using cmProp = const std::string*;
+
class cmTargetPropertyComputer
{
public:
template <typename Target>
- static const char* GetProperty(Target const* tgt, const std::string& prop,
- cmMessenger* messenger,
- cmListFileBacktrace const& context)
+ static cmProp GetProperty(Target const* tgt, const std::string& prop,
+ cmMessenger* messenger,
+ cmListFileBacktrace const& context)
{
- if (const char* loc = GetLocation(tgt, prop, messenger, context)) {
+ if (cmProp loc = GetLocation(tgt, prop, messenger, context)) {
return loc;
}
if (cmSystemTools::GetFatalErrorOccured()) {
@@ -52,9 +54,9 @@ private:
std::string const& config);
template <typename Target>
- static const char* GetLocation(Target const* tgt, std::string const& prop,
- cmMessenger* messenger,
- cmListFileBacktrace const& context)
+ static cmProp GetLocation(Target const* tgt, std::string const& prop,
+ cmMessenger* messenger,
+ cmListFileBacktrace const& context)
{
// Watch for special "computed" properties that are dependent on
@@ -71,7 +73,7 @@ private:
context)) {
return nullptr;
}
- return ComputeLocationForBuild(tgt).c_str();
+ return &ComputeLocationForBuild(tgt);
}
// Support "LOCATION_<CONFIG>".
@@ -82,7 +84,7 @@ private:
return nullptr;
}
std::string configName = prop.substr(9);
- return ComputeLocation(tgt, configName).c_str();
+ return &ComputeLocation(tgt, configName);
}
// Support "<CONFIG>_LOCATION".
@@ -95,7 +97,7 @@ private:
context)) {
return nullptr;
}
- return ComputeLocation(tgt, configName).c_str();
+ return &ComputeLocation(tgt, configName);
}
}
}
@@ -103,8 +105,8 @@ private:
}
template <typename Target>
- static const char* GetSources(Target const* tgt, cmMessenger* messenger,
- cmListFileBacktrace const& context);
+ static cmProp GetSources(Target const* tgt, cmMessenger* messenger,
+ cmListFileBacktrace const& context);
};
#endif