本文整理汇总了C++中ProcessParameters::setMacroExpander方法的典型用法代码示例。如果您正苦于以下问题:C++ ProcessParameters::setMacroExpander方法的具体用法?C++ ProcessParameters::setMacroExpander怎么用?C++ ProcessParameters::setMacroExpander使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProcessParameters
的用法示例。
在下文中一共展示了ProcessParameters::setMacroExpander方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool IosPresetBuildStep::init(QList<const BuildStep *> &earlierSteps)
{
BuildConfiguration *bc = buildConfiguration();
if (!bc)
bc = target()->activeBuildConfiguration();
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setWorkingDirectory(bc->buildDirectory().toString());
Utils::Environment env = bc->environment();
Utils::Environment::setupEnglishOutput(&env);
pp->setEnvironment(env);
pp->setCommand(command());
pp->setArguments(Utils::QtcProcess::joinArgs(arguments()));
pp->resolveAll();
// If we are cleaning, then build can fail with an error code, but that doesn't mean
// we should stop the clean queue
// That is mostly so that rebuild works on an already clean project
setIgnoreReturnValue(m_clean);
setOutputParser(target()->kit()->createOutputParser());
if (outputParser())
outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory());
return AbstractProcessStep::init(earlierSteps);
}
示例2: init
bool QMakeStep::init()
{
QmakeBuildConfiguration *qt4bc = qmakeBuildConfiguration();
const QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (!qtVersion)
return false;
QString args = allArguments();
QString workingDirectory;
if (qt4bc->subNodeBuild())
workingDirectory = qt4bc->subNodeBuild()->buildDir();
else
workingDirectory = qt4bc->buildDirectory().toString();
FileName program = qtVersion->qmakeCommand();
QString makefile = workingDirectory;
if (qt4bc->subNodeBuild()) {
if (!qt4bc->subNodeBuild()->makefile().isEmpty())
makefile.append(qt4bc->subNodeBuild()->makefile());
else
makefile.append(QLatin1String("/Makefile"));
} else if (!qt4bc->makefile().isEmpty()) {
makefile.append(QLatin1Char('/'));
makefile.append(qt4bc->makefile());
} else {
makefile.append(QLatin1String("/Makefile"));
}
// Check whether we need to run qmake
bool makefileOutDated = (qt4bc->compareToImportFrom(makefile) != QmakeBuildConfiguration::MakefileMatches);
if (m_forced || makefileOutDated)
m_needToRunQMake = true;
m_forced = false;
ProcessParameters *pp = processParameters();
pp->setMacroExpander(qt4bc->macroExpander());
pp->setWorkingDirectory(workingDirectory);
pp->setCommand(program.toString());
pp->setArguments(args);
pp->setEnvironment(qt4bc->environment());
pp->resolveAll();
setOutputParser(new QMakeParser);
QmakeProFileNode *node = static_cast<QmakeProject *>(qt4bc->target()->project())->rootQmakeProjectNode();
if (qt4bc->subNodeBuild())
node = qt4bc->subNodeBuild();
QString proFile = node->path();
m_tasks = qtVersion->reportIssues(proFile, workingDirectory);
qSort(m_tasks);
m_scriptTemplate = node->projectType() == ScriptTemplate;
return AbstractProcessStep::init();
}
示例3: init
bool DMakeStep::init(QList<const BuildStep *> &earlierSteps)
{
BuildConfiguration *bc = buildConfiguration();
if (!bc)
bc = target()->activeBuildConfiguration();
m_tasks.clear();
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ToolChain::Language::Cxx);
if (!tc) {
m_tasks.append(Task(Task::Error, tr("Qt Creator needs a compiler set up to build. Configure a compiler in the kit options."),
Utils::FileName(), -1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
return true; // otherwise the tasks will not get reported
}
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setWorkingDirectory(bc->buildDirectory().toString());
Utils::Environment env = bc->environment();
// Force output to english for the parsers. Do this here and not in the toolchain's
// addToEnvironment() to not screw up the users run environment.
env.set(QLatin1String("LC_ALL"), QLatin1String("C"));
pp->setEnvironment(env);
pp->setCommand(makeCommand(bc->environment()));
pp->setArguments(allArguments());
pp->resolveAll();
setOutputParser(new GnuMakeParser());
IOutputParser *parser = target()->kit()->createOutputParser();
if (parser)
appendOutputParser(parser);
outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory());
return AbstractProcessStep::init(earlierSteps);
}
示例4: init
bool MerLocalRsyncDeployStep::init()
{
Qt4ProjectManager::Qt4BuildConfiguration *bc = qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration*>(buildConfiguration());
if (!bc)
bc = qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration*>(target()->activeBuildConfiguration());
if (!bc) {
addOutput(tr("Cannot deploy: No active build configuration."),
ErrorMessageOutput);
return false;
}
const MerSdk *const merSdk = MerSdkKitInformation::sdk(target()->kit());
if (!merSdk) {
addOutput(tr("Cannot deploy: Missing MerSdk information in the kit"),ErrorMessageOutput);
return false;
}
const QString target = MerTargetKitInformation::targetName(this->target()->kit());
if (target.isEmpty()) {
addOutput(tr("Cannot deploy: Missing MerTarget information in the kit"),ErrorMessageOutput);
return false;
}
IDevice::ConstPtr device = DeviceKitInformation::device(this->target()->kit());
//TODO: HACK
if (device.isNull() && DeviceTypeKitInformation::deviceTypeId(this->target()->kit()) != Constants::MER_DEVICE_TYPE_ARM) {
addOutput(tr("Cannot deploy: Missing MerDevice information in the kit"),ErrorMessageOutput);
return false;
}
const QString projectDirectory = bc->shadowBuild() ? bc->shadowBuildDirectory() : project()->projectDirectory();
const QString deployCommand = QLatin1String("rsync");
ProcessParameters *pp = processParameters();
Utils::Environment env = bc ? bc->environment() : Utils::Environment::systemEnvironment();
//TODO HACK
if(!device.isNull())
env.appendOrSet(QLatin1String(Constants::MER_SSH_DEVICE_NAME),device->displayName());
pp->setMacroExpander(bc ? bc->macroExpander() : Core::VariableManager::instance()->macroExpander());
pp->setEnvironment(env);
pp->setWorkingDirectory(projectDirectory);
pp->setCommand(deployCommand);
pp->setArguments(arguments());
return AbstractProcessStep::init();
}
示例5: updateDetails
void ConfigureStepConfigWidget::updateDetails()
{
BuildConfiguration *bc = m_configureStep->buildConfiguration();
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->buildDirectory().toString());
param.setCommand(projectDirRelativeToBuildDir(bc) + QLatin1String("configure"));
param.setArguments(m_configureStep->additionalArguments());
m_summaryText = param.summaryInWorkdir(displayName());
emit updateSummary();
}
示例6: init
bool ProcessStep::init()
{
BuildConfiguration *bc = buildConfiguration();
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
pp->setWorkingDirectory(workingDirectory());
pp->setCommand(m_command);
pp->setArguments(m_arguments);
AbstractProcessStep::setEnabled(m_enabled);
setOutputParser(bc->createOutputParser());
return AbstractProcessStep::init();
}
示例7: updateDetails
void MakeStepConfigWidget::updateDetails()
{
ToolChain *tc
= ToolChainKitInformation::toolChain(m_makeStep->target()->kit());
QmakeBuildConfiguration *bc = m_makeStep->qmakeBuildConfiguration();
if (!bc)
bc = qobject_cast<QmakeBuildConfiguration *>(m_makeStep->target()->activeBuildConfiguration());
if (tc && bc)
m_ui->makeLabel->setText(tr("Override %1:").arg(QDir::toNativeSeparators(tc->makeCommand(bc->environment()))));
else
m_ui->makeLabel->setText(tr("Make:"));
if (!tc) {
setSummaryText(tr("<b>Make:</b> %1").arg(ProjectExplorer::ToolChainKitInformation::msgNoToolChainInTarget()));
return;
}
if (!bc) {
setSummaryText(tr("<b>Make:</b> No Qt build configuration."));
return;
}
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setWorkingDirectory(bc->buildDirectory().toString());
QString makeCmd = tc->makeCommand(bc->environment());
if (!m_makeStep->makeCommand().isEmpty())
makeCmd = m_makeStep->makeCommand();
param.setCommand(makeCmd);
QString args = m_makeStep->userArguments();
Utils::Environment env = bc->environment();
Utils::Environment::setupEnglishOutput(&env);
// We prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose
// FIXME doing this without the user having a way to override this is rather bad
if (tc && m_makeStep->makeCommand().isEmpty()) {
if (tc->targetAbi().os() == Abi::WindowsOS
&& tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor) {
const QString makeFlags = QLatin1String("MAKEFLAGS");
env.set(makeFlags, QLatin1Char('L') + env.value(makeFlags));
}
}
param.setArguments(args);
param.setEnvironment(env);
if (param.commandMissing())
setSummaryText(tr("<b>Make:</b> %1 not found in the environment.").arg(makeCmd)); // Override display text
else
setSummaryText(param.summaryInWorkdir(displayName()));
}
示例8: updateDetails
void AutogenStepConfigWidget::updateDetails()
{
BuildConfiguration *bc = m_autogenStep->buildConfiguration();
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
const QString projectDir(bc->target()->project()->projectDirectory().toString());
param.setWorkingDirectory(projectDir);
param.setCommand(QLatin1String("./autogen.sh"));
param.setArguments(m_autogenStep->additionalArguments());
m_summaryText = param.summary(displayName());
emit updateSummary();
}
示例9: init
bool ConfigureStep::init(QList<const BuildStep *> &earlierSteps)
{
BuildConfiguration *bc = buildConfiguration();
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
pp->setWorkingDirectory(bc->buildDirectory().toString());
pp->setCommand(projectDirRelativeToBuildDir(bc) + QLatin1String("configure"));
pp->setArguments(additionalArguments());
pp->resolveAll();
return AbstractProcessStep::init(earlierSteps);
}
示例10: init
bool ProcessStep::init()
{
BuildConfiguration *bc = buildConfiguration();
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc ? bc->macroExpander() : Utils::globalMacroExpander());
pp->setEnvironment(bc ? bc->environment() : Utils::Environment::systemEnvironment());
pp->setWorkingDirectory(workingDirectory());
pp->setCommand(m_command);
pp->setArguments(m_arguments);
pp->resolveAll();
setOutputParser(target()->kit()->createOutputParser());
return AbstractProcessStep::init();
}
示例11: updateDetails
void GenericMakeStepConfigWidget::updateDetails()
{
BuildConfiguration *bc = m_makeStep->buildConfiguration();
if (!bc)
bc = m_makeStep->target()->activeBuildConfiguration();
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setWorkingDirectory(bc->buildDirectory().toString());
param.setEnvironment(bc->environment());
param.setCommand(m_makeStep->makeCommand(bc->environment()));
param.setArguments(m_makeStep->allArguments());
m_summaryText = param.summary(displayName());
emit updateSummary();
}
示例12: init
bool AutogenStep::init()
{
BuildConfiguration *bc = buildConfiguration();
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
const QString projectDir(bc->target()->project()->projectDirectory().toString());
pp->setWorkingDirectory(projectDir);
pp->setCommand(QLatin1String("./autogen.sh"));
pp->setArguments(additionalArguments());
pp->resolveAll();
return AbstractProcessStep::init();
}
示例13: updateDetails
void IosPresetBuildStepConfigWidget::updateDetails()
{
BuildConfiguration *bc = m_buildStep->buildConfiguration();
if (!bc)
bc = m_buildStep->target()->activeBuildConfiguration();
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setWorkingDirectory(bc->buildDirectory().toString());
param.setEnvironment(bc->environment());
param.setCommand(m_buildStep->command());
param.setArguments(Utils::QtcProcess::joinArgs(m_buildStep->arguments()));
m_summaryText = param.summary(displayName());
emit updateSummary();
}
示例14: updateDetails
void ProcessStepConfigWidget::updateDetails()
{
QString displayName = m_step->displayName();
if (displayName.isEmpty())
displayName = tr("Custom Process Step");
ProcessParameters param;
BuildConfiguration *bc = m_step->buildConfiguration();
param.setMacroExpander(bc ? bc->macroExpander() : Utils::globalMacroExpander());
param.setEnvironment(bc ? bc->environment() : Utils::Environment::systemEnvironment());
param.setWorkingDirectory(m_step->workingDirectory());
param.setCommand(m_step->command());
param.setArguments(m_step->arguments());
m_summaryText = param.summary(displayName);
emit updateSummary();
}
示例15: init
bool MakeStep::init()
{
CMakeBuildConfiguration *bc = cmakeBuildConfiguration();
if (!bc)
bc = targetsActiveBuildConfiguration();
if (!bc)
emit addTask(Task::buildConfigurationMissingTask());
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
if (!tc)
emit addTask(Task::compilerMissingTask());
if (!bc || !tc) {
emitFaultyConfigurationMessage();
return false;
}
m_useNinja = bc->useNinja();
QString arguments = Utils::QtcProcess::joinArgs(m_buildTargets);
Utils::QtcProcess::addArgs(&arguments, additionalArguments());
setIgnoreReturnValue(m_clean);
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
Utils::Environment env = bc->environment();
// Force output to english for the parsers. Do this here and not in the toolchain's
// addToEnvironment() to not screw up the users run environment.
env.set(QLatin1String("LC_ALL"), QLatin1String("C"));
if (m_useNinja && !env.value(QLatin1String("NINJA_STATUS")).startsWith(m_ninjaProgressString))
env.set(QLatin1String("NINJA_STATUS"), m_ninjaProgressString + QLatin1String("%o/sec] "));
pp->setEnvironment(env);
pp->setWorkingDirectory(bc->buildDirectory().toString());
pp->setCommand(makeCommand(tc, bc->environment()));
pp->setArguments(arguments);
pp->resolveAll();
setOutputParser(new CMakeParser());
IOutputParser *parser = target()->kit()->createOutputParser();
if (parser)
appendOutputParser(parser);
outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory());
return AbstractProcessStep::init();
}