QtAutogen: Move util functions to file begin

This commit is contained in:
Sebastian Holtermann
2016-11-30 11:19:28 +01:00
parent 048aac2cf9
commit 2e18801a1b

View File

@@ -35,6 +35,26 @@
#include <utility>
#include <vector>
static void utilCopyTargetProperty(cmTarget* destinationTarget,
cmTarget* sourceTarget,
const std::string& propertyName)
{
const char* propertyValue = sourceTarget->GetProperty(propertyName);
if (propertyValue) {
destinationTarget->SetProperty(propertyName, propertyValue);
}
}
static std::string utilStripCR(std::string const& line)
{
// Strip CR characters rcc may have printed (possibly more than one!).
std::string::size_type cr = line.find('\r');
if (cr != line.npos) {
return line.substr(0, cr);
}
return line;
}
static std::string GetAutogenTargetName(cmGeneratorTarget const* target)
{
std::string autogenTargetName = target->GetName();
@@ -404,26 +424,6 @@ static void RccMergeOptions(std::vector<std::string>& opts,
opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
}
static void utilCopyTargetProperty(cmTarget* destinationTarget,
cmTarget* sourceTarget,
const std::string& propertyName)
{
const char* propertyValue = sourceTarget->GetProperty(propertyName);
if (propertyValue) {
destinationTarget->SetProperty(propertyName, propertyValue);
}
}
static std::string utilStripCR(std::string const& line)
{
// Strip CR characters rcc may have printed (possibly more than one!).
std::string::size_type cr = line.find('\r');
if (cr != line.npos) {
return line.substr(0, cr);
}
return line;
}
/// @brief Reads the resource files list from from a .qrc file - Qt5 version
/// @return True if the .qrc file was successfully parsed
static bool RccListInputsQt5(cmSourceFile* sf, cmGeneratorTarget const* target,