本文整理汇总了C++中QmakeBuildConfiguration::compareToImportFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ QmakeBuildConfiguration::compareToImportFrom方法的具体用法?C++ QmakeBuildConfiguration::compareToImportFrom怎么用?C++ QmakeBuildConfiguration::compareToImportFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QmakeBuildConfiguration
的用法示例。
在下文中一共展示了QmakeBuildConfiguration::compareToImportFrom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool QMakeStep::init(QList<const BuildStep *> &earlierSteps)
{
if (m_commandFuture)
return false;
QmakeBuildConfiguration *qmakeBc = qmakeBuildConfiguration();
const BaseQtVersion *qtVersion = QtKitInformation::qtVersion(target()->kit());
if (!qtVersion)
return false;
QString workingDirectory;
if (qmakeBc->subNodeBuild())
workingDirectory = qmakeBc->subNodeBuild()->buildDir();
else
workingDirectory = qmakeBc->buildDirectory().toString();
m_qmakeExecutable = qtVersion->qmakeCommand().toString();
m_qmakeArguments = allArguments(qtVersion);
m_runMakeQmake = (qtVersion->qtVersion() >= QtVersionNumber(5, 0 ,0));
if (m_runMakeQmake) {
m_makeExecutable = makeCommand();
if (m_makeExecutable.isEmpty())
return false;
} else {
m_makeExecutable.clear();
}
QString makefile = workingDirectory;
if (qmakeBc->subNodeBuild()) {
if (!qmakeBc->subNodeBuild()->makefile().isEmpty())
makefile.append(qmakeBc->subNodeBuild()->makefile());
else
makefile.append(QLatin1String("/Makefile"));
} else if (!qmakeBc->makefile().isEmpty()) {
makefile.append(QLatin1Char('/'));
makefile.append(qmakeBc->makefile());
} else {
makefile.append(QLatin1String("/Makefile"));
}
// Check whether we need to run qmake
bool makefileOutDated = (qmakeBc->compareToImportFrom(makefile) != QmakeBuildConfiguration::MakefileMatches);
if (m_forced || makefileOutDated)
m_needToRunQMake = true;
m_forced = false;
ProcessParameters *pp = processParameters();
pp->setMacroExpander(qmakeBc->macroExpander());
pp->setWorkingDirectory(workingDirectory);
pp->setEnvironment(qmakeBc->environment());
setOutputParser(new QMakeParser);
QmakeProFileNode *node = static_cast<QmakeProject *>(qmakeBc->target()->project())->rootProjectNode();
if (qmakeBc->subNodeBuild())
node = qmakeBc->subNodeBuild();
QString proFile = node->filePath().toString();
QList<ProjectExplorer::Task> tasks = qtVersion->reportIssues(proFile, workingDirectory);
Utils::sort(tasks);
if (!tasks.isEmpty()) {
bool canContinue = true;
foreach (const ProjectExplorer::Task &t, tasks) {
addTask(t);
if (t.type == Task::Error)
canContinue = false;
}