/// /// moreArguments, /// -unix for Maemo /// -after OBJECTS_DIR, MOC_DIR, UI_DIR, RCC_DIR /// QMAKE_VAR_QMLJSDEBUGGER_PATH QStringList QMakeStep::moreArguments() { Qt4BuildConfiguration *bc = qt4BuildConfiguration(); QStringList arguments; #if defined(Q_OS_WIN) || defined(Q_OS_MAC) ProjectExplorer::ToolChain *tc = bc->toolChain(); if (tc && (tc->targetAbi().osFlavor() == ProjectExplorer::Abi::HarmattanLinuxFlavor || tc->targetAbi().osFlavor() == ProjectExplorer::Abi::MaemoLinuxFlavor)) arguments << QLatin1String("-unix"); #endif if (linkQmlDebuggingLibrary() && bc->qtVersion()) { if (!bc->qtVersion()->needsQmlDebuggingLibrary()) { // This Qt version has the QML debugging services built in, however // they still need to be enabled at compile time arguments << QLatin1String("CONFIG+=declarative_debug"); } else { QString qmlDebuggingHelperLibrary = bc->qtVersion()->qmlDebuggingHelperLibrary(true); if (!qmlDebuggingHelperLibrary.isEmpty()) { // Do not turn debugger path into native path separators: Qmake does not like that! const QString debuggingHelperPath = QFileInfo(qmlDebuggingHelperLibrary).dir().path(); arguments << QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH) + QLatin1Char('=') + debuggingHelperPath; } } } if (bc->qtVersion() && !bc->qtVersion()->supportsShadowBuilds()) { // We have a target which does not allow shadow building. // But we really don't want to have the build artefacts in the source dir // so we try to hack around it, to make the common cases work. // This is a HACK, remove once the symbian make generator supports // shadow building arguments << QLatin1String("-after") << QLatin1String("OBJECTS_DIR=obj") << QLatin1String("MOC_DIR=moc") << QLatin1String("UI_DIR=ui") << QLatin1String("RCC_DIR=rcc"); } return arguments; }
void MakeStepConfigWidget::updateDetails() { Qt4BuildConfiguration *bc = m_makeStep->qt4BuildConfiguration(); QString workingDirectory = bc->buildDirectory(); QString makeCmd = bc->makeCommand(); if (!m_makeStep->m_makeCmd.isEmpty()) makeCmd = m_makeStep->m_makeCmd; if (!QFileInfo(makeCmd).isAbsolute()) { Environment environment = bc->environment(); // Try to detect command in environment const QString tmp = environment.searchInPath(makeCmd); if (tmp.isEmpty()) { m_summaryText = tr("<b>Make:</b> %1 not found in the environment.").arg(makeCmd); emit updateSummary(); return; } makeCmd = tmp; } // -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the // absolute file path // FIXME doing this without the user having a way to override this is rather bad // so we only do it for unix and if the user didn't override the make command // but for now this is the least invasive change QStringList args = m_makeStep->userArguments(); ProjectExplorer::ToolChain::ToolChainType t = ProjectExplorer::ToolChain::UNKNOWN; ProjectExplorer::ToolChain *toolChain = bc->toolChain(); if (toolChain) t = toolChain->type(); if (t != ProjectExplorer::ToolChain::MSVC && t != ProjectExplorer::ToolChain::WINCE) { if (m_makeStep->m_makeCmd.isEmpty()) args << "-w"; } m_summaryText = tr("<b>Make:</b> %1 %2 in %3").arg(QFileInfo(makeCmd).fileName(), args.join(" "), QDir::toNativeSeparators(workingDirectory)); emit updateSummary(); }
bool MakeStep::init() { Qt4BuildConfiguration *bc = qt4BuildConfiguration(); m_tasks.clear(); if (!bc->toolChain()) { m_tasks.append(ProjectExplorer::Task(ProjectExplorer::Task::Error, tr("Qt Creator needs a tool chain set up to build. Please configure a tool chain in Project mode."), QString(), -1, QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); } ProjectExplorer::ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); Utils::Environment environment = bc->environment(); pp->setEnvironment(environment); QString workingDirectory; if (bc->subNodeBuild()) workingDirectory = bc->subNodeBuild()->buildDir(); else workingDirectory = bc->buildDirectory(); pp->setWorkingDirectory(workingDirectory); QString makeCmd = bc->makeCommand(); if (!m_makeCmd.isEmpty()) makeCmd = m_makeCmd; pp->setCommand(makeCmd); // If we are cleaning, then make can fail with a error code, but that doesn't mean // we should stop the clean queue // That is mostly so that rebuild works on a already clean project setIgnoreReturnValue(m_clean); QString args; ProjectExplorer::ToolChain *toolchain = bc->toolChain(); if (bc->subNodeBuild()) { QString makefile = bc->subNodeBuild()->makefile(); if(!makefile.isEmpty()) { Utils::QtcProcess::addArg(&args, QLatin1String("-f")); Utils::QtcProcess::addArg(&args, makefile); m_makeFileToCheck = QDir(workingDirectory).filePath(makefile); } else { m_makeFileToCheck = QDir(workingDirectory).filePath("Makefile"); } } else { if (!bc->makefile().isEmpty()) { Utils::QtcProcess::addArg(&args, QLatin1String("-f")); Utils::QtcProcess::addArg(&args, bc->makefile()); m_makeFileToCheck = QDir(workingDirectory).filePath(bc->makefile()); } else { m_makeFileToCheck = QDir(workingDirectory).filePath("Makefile"); } } Utils::QtcProcess::addArgs(&args, m_userArgs); if (!isClean()) { if (!bc->defaultMakeTarget().isEmpty()) Utils::QtcProcess::addArg(&args, bc->defaultMakeTarget()); } // -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the // absolute file path // FIXME doing this without the user having a way to override this is rather bad // so we only do it for unix and if the user didn't override the make command // but for now this is the least invasive change if (toolchain && toolchain->targetAbi().binaryFormat() != ProjectExplorer::Abi::PEFormat && m_makeCmd.isEmpty()) Utils::QtcProcess::addArg(&args, QLatin1String("-w")); setEnabled(true); pp->setArguments(args); ProjectExplorer::IOutputParser *parser = 0; if (bc->qtVersion()) parser = bc->qtVersion()->createOutputParser(); if (parser) parser->appendOutputParser(new QtSupport::QtParser); else parser = new QtSupport::QtParser; if (toolchain) parser->appendOutputParser(toolchain->outputParser()); parser->setWorkingDirectory(workingDirectory); setOutputParser(parser); return AbstractProcessStep::init(); }
bool MakeStep::init() { Qt4BuildConfiguration *bc = qt4BuildConfiguration(); Environment environment = bc->environment(); setEnvironment(environment); QString workingDirectory; if (bc->subNodeBuild()) workingDirectory = bc->subNodeBuild()->buildDir(); else workingDirectory = bc->buildDirectory(); setWorkingDirectory(workingDirectory); QString makeCmd = bc->makeCommand(); if (!m_makeCmd.isEmpty()) makeCmd = m_makeCmd; if (!QFileInfo(makeCmd).isAbsolute()) { // Try to detect command in environment const QString tmp = environment.searchInPath(makeCmd); if (tmp.isEmpty()) { QTextCharFormat textCharFormat; textCharFormat.setForeground(Qt::red); emit addOutput(tr("Could not find make command: %1 in the build environment").arg(makeCmd), textCharFormat); return false; } makeCmd = tmp; } setCommand(makeCmd); // If we are cleaning, then make can fail with a error code, but that doesn't mean // we should stop the clean queue // That is mostly so that rebuild works on a already clean project setIgnoreReturnValue(m_clean); QStringList args = m_userArgs; if (!m_clean) { if (!bc->defaultMakeTarget().isEmpty()) args << bc->defaultMakeTarget(); } // -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the // absolute file path // FIXME doing this without the user having a way to override this is rather bad // so we only do it for unix and if the user didn't override the make command // but for now this is the least invasive change ProjectExplorer::ToolChain *toolchain = bc->toolChain(); if (toolchain) { if (toolchain->type() != ProjectExplorer::ToolChain::MSVC && toolchain->type() != ProjectExplorer::ToolChain::WINCE) { if (m_makeCmd.isEmpty()) args << "-w"; } } setEnabled(true); setArguments(args); setOutputParser(new ProjectExplorer::GnuMakeParser(workingDirectory)); if (toolchain) appendOutputParser(toolchain->outputParser()); return AbstractProcessStep::init(); }