Standardize on "Executable" in UI & API, do not mix with "Binary"

Summary:
For UI:
* KDevelop supports both scripting and compiled languages,
  so e.g. debugging target can be non-binary
* external tools might be known as binary-only, but sometimes they
  are inside wrapper scripts and no place really requires a compiled binary
* consistent terms help users & also translators

For API/variable names:
* "executable" matches API of Qt
* consistent with UI language

Config storage keys not touched for now, might need more thinking.

Depends on D4592

Reviewers: #kdevelop, apol

Reviewed By: #kdevelop, apol

Subscribers: flherne, kdevelop-devel

Differential Revision: https://phabricator.kde.org/D4593
parent cb198728
......@@ -38,7 +38,7 @@ QString KDevIDEExtension::xmlFile()
return "kdevelopui.rc";
}
QString KDevIDEExtension::binaryPath()
QString KDevIDEExtension::executableFilePath()
{
return QApplication::applicationDirPath() + "/kdevelop";
}
......
......@@ -27,7 +27,7 @@ public:
static void init();
QString xmlFile() override;
QString binaryPath() override;
QString executableFilePath() override;
KDevelop::AreaParams defaultArea() override;
QString projectFileExtension() override;
QString projectFileDescription() override;
......
......@@ -428,7 +428,7 @@ int main( int argc, char *argv[] )
parser.addOption(QCommandLineOption{QStringList{"p", "project"}, i18n("Open KDevelop and load the given project."), "project"});
parser.addOption(QCommandLineOption{QStringList{"d", "debug"},
i18n("Start debugging an application in KDevelop with the given debugger.\n"
"The binary that should be debugged must follow - including arguments.\n"
"The executable that should be debugged must follow - including arguments.\n"
"Example: kdevelop --debug gdb myapp --foo bar"), "debugger"});
// this is used by the 'kdevelop!' script to retrieve the pid of a KDEVELOP
......@@ -558,22 +558,22 @@ int main( int argc, char *argv[] )
if ( parser.isSet("debug") ) {
if ( debugArgs.isEmpty() ) {
QTextStream qerr(stderr);
qerr << endl << i18nc("@info:shell", "Specify the binary you want to debug.") << endl;
qerr << endl << i18nc("@info:shell", "Specify the executable you want to debug.") << endl;
return 1;
}
QFileInfo binaryInfo(debugArgs.first());
if (!binaryInfo.exists()) {
binaryInfo = QStandardPaths::findExecutable(debugArgs.first());
if (!binaryInfo.exists()) {
QFileInfo executableFileInfo(debugArgs.first());
if (!executableFileInfo.exists()) {
executableFileInfo = QStandardPaths::findExecutable(debugArgs.first());
if (!executableFileInfo.exists()) {
QTextStream qerr(stderr);
qerr << endl << i18nc("@info:shell", "Specified binary does not exist.") << endl;
qerr << endl << i18nc("@info:shell", "Specified executable does not exist.") << endl;
return 1;
}
}
debugArgs.first() = binaryInfo.absoluteFilePath();
debugeeName = i18n("Debug %1", binaryInfo.fileName());
debugArgs.first() = executableFileInfo.absoluteFilePath();
debugeeName = i18n("Debug %1", executableFileInfo.fileName());
session = debugeeName;
} else if ( parser.isSet("new-session") )
{
......
......@@ -33,9 +33,9 @@ SelectCoreDialog::SelectCoreDialog(QWidget* parent)
setWindowTitle(i18n("Select Core File"));
}
QUrl SelectCoreDialog::binary() const
QUrl SelectCoreDialog::executableFile() const
{
return m_ui.binaryFile->url();
return m_ui.executableFile->url();
}
QUrl SelectCoreDialog::core() const
......
......@@ -33,7 +33,7 @@ class SelectCoreDialog : public QDialog
{
public:
explicit SelectCoreDialog(QWidget *parent = nullptr);
QUrl binary() const;
QUrl executableFile() const;
QUrl core() const;
private:
......
......@@ -19,7 +19,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="binaryFile"/>
<widget class="KUrlRequester" name="executableFile"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
......
......@@ -328,7 +328,7 @@ void MIDebugger::processErrored(QProcess::ProcessError error)
i18n("<b>Could not start debugger.</b>"
"<p>Could not run '%1'. "
"Make sure that the path name is specified correctly.",
debuggerBinary_),
debuggerExecutable_),
i18n("Could not start debugger"));
emit userCommandOutput("Process failed to start\n");
......@@ -341,7 +341,7 @@ void MIDebugger::processErrored(QProcess::ProcessError error)
"<p>The debugger process '%1' crashed.<br>"
"Because of that the debug session has to be ended.<br>"
"Try to reproduce the crash without KDevelop and report a bug.<br>",
debuggerBinary_),
debuggerExecutable_),
i18n("Debugger crashed"));
emit userCommandOutput("Process crashed\n");
......
......@@ -135,7 +135,7 @@ protected:
void processLine(const QByteArray& line);
protected:
QString debuggerBinary_;
QString debuggerExecutable_;
KProcess* process_;
MI::MICommand* currentCmd_;
......
......@@ -172,7 +172,7 @@ void MIExamineCoreJob::start()
return;
}
if (!m_session->examineCoreFile(dlg.binary(), dlg.core())) {
if (!m_session->examineCoreFile(dlg.executableFile(), dlg.core())) {
done();
}
}
......
......@@ -53,10 +53,10 @@ bool GdbDebugger::start(KConfigGroup& config, const QStringList& extraArguments)
// FIXME: verify that default value leads to something sensible
QUrl gdbUrl = config.readEntry(Config::GdbPathEntry, QUrl());
if (gdbUrl.isEmpty()) {
debuggerBinary_ = "gdb";
debuggerExecutable_ = QStringLiteral("gdb");
} else {
// FIXME: verify its' a local path.
debuggerBinary_ = gdbUrl.url(QUrl::PreferLocalFile | QUrl::StripTrailingSlash);
debuggerExecutable_ = gdbUrl.url(QUrl::PreferLocalFile | QUrl::StripTrailingSlash);
}
QStringList arguments = extraArguments;
......@@ -81,19 +81,19 @@ bool GdbDebugger::start(KConfigGroup& config, const QStringList& extraArguments)
return false;
}
arguments.insert(0, debuggerBinary_);
arguments.insert(0, debuggerExecutable_);
arguments.insert(0, shell.toLocalFile());
process_->setShellCommand(KShell::joinArgs(arguments));
} else {
process_->setProgram(debuggerBinary_, arguments);
process_->setProgram(debuggerExecutable_, arguments);
}
process_->start();
qCDebug(DEBUGGERGDB) << "Starting GDB with command" << shell.toLocalFile() + ' ' + debuggerBinary_
+ ' ' + arguments.join(' ');
qCDebug(DEBUGGERGDB) << "Starting GDB with command" << shell.toLocalFile() + QLatin1Char(' ') + debuggerExecutable_
+ QLatin1Char(' ') + arguments.join(QLatin1Char(' '));
qCDebug(DEBUGGERGDB) << "GDB process pid:" << process_->pid();
emit userCommandOutput(shell.toLocalFile() + ' ' + debuggerBinary_
+ ' ' + arguments.join(' ') + '\n');
emit userCommandOutput(shell.toLocalFile() + QLatin1Char(' ') + debuggerExecutable_
+ QLatin1Char(' ') + arguments.join(QLatin1Char(' ')) + QLatin1Char('\n'));
return true;
}
......@@ -45,7 +45,7 @@
<string>Gdb executable</string>
</property>
<property name="whatsThis">
<string>To run &quot;gdb&quot; binary from $PATH, leave this field empty. To run custom gdb, for example, for a different architecture, enter the executable name here. You can either run gdb from $PATH, but with a different name (say, &quot;arm-gdb&quot;), by typing the name here, or specify full path to the gdb executable.</string>
<string>To run &quot;gdb&quot; executable from $PATH, leave this field empty. To run custom gdb, for example, for a different architecture, enter the executable name here. You can either run gdb from $PATH, but with a different name (say, &quot;arm-gdb&quot;), by typing the name here, or specify full path to the gdb executable.</string>
</property>
<property name="placeholderText" stdset="0">
<string>Override path to gdb executable</string>
......
......@@ -51,9 +51,9 @@ bool LldbDebugger::start(KConfigGroup& config, const QStringList& extraArguments
// Get path to executable
QUrl lldbUrl = config.readEntry(Config::LldbExecutableEntry, QUrl());
if (!lldbUrl.isValid() || !lldbUrl.isLocalFile()) {
debuggerBinary_ = "lldb-mi";
debuggerExecutable_ = QStringLiteral("lldb-mi");
} else {
debuggerBinary_ = lldbUrl.toLocalFile();
debuggerExecutable_ = lldbUrl.toLocalFile();
}
// Get arguments
......@@ -74,12 +74,12 @@ bool LldbDebugger::start(KConfigGroup& config, const QStringList& extraArguments
// Start!
process_->setProcessEnvironment(processEnv);
process_->setProgram(debuggerBinary_, arguments);
process_->setProgram(debuggerExecutable_, arguments);
process_->start();
qCDebug(DEBUGGERLLDB) << "Starting LLDB with command" << debuggerBinary_ + ' ' + arguments.join(' ');
qCDebug(DEBUGGERLLDB) << "Starting LLDB with command" << debuggerExecutable_ + QLatin1Char(' ') + arguments.join(QLatin1Char(' '));
qCDebug(DEBUGGERLLDB) << "LLDB process pid:" << process_->pid();
emit userCommandOutput(debuggerBinary_ + ' ' + arguments.join(' ') + '\n');
emit userCommandOutput(debuggerExecutable_ + QLatin1Char(' ') + arguments.join(QLatin1Char(' ')) + QLatin1Char('\n'));
return true;
}
......@@ -67,7 +67,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Compiler path:</string>
<string>Compiler executable:</string>
</property>
</widget>
</item>
......
......@@ -6,7 +6,7 @@
<include>cmakeutils.h</include>
<kcfgfile name="kdeveloprc"/>
<group name="CMakeBuilder">
<entry name="cmakeExe" key="cmakeExe" type="String">
<entry name="cmakeExecutable" key="cmakeExe" type="String">
<default code="true">CMake::findExecutable()</default>
<whatsthis>The path to the default CMake executable.</whatsthis>
</entry>
......
......@@ -35,11 +35,11 @@ CMakeBuilderPreferences::CMakeBuilderPreferences(KDevelop::IPlugin* plugin, QWid
m_prefsUi->setupUi(this);
#ifdef Q_OS_WIN
m_prefsUi->kcfg_cmakeExe->setFilter("*.exe");
m_prefsUi->kcfg_cmakeExecutable->setFilter(QStringLiteral("*.exe"));
#endif
m_prefsUi->kcfg_cmakeExe->setToolTip(CMakeBuilderSettings::self()->cmakeExeItem()->whatsThis());
m_prefsUi->label1->setToolTip(CMakeBuilderSettings::self()->cmakeExeItem()->whatsThis());
m_prefsUi->kcfg_cmakeExecutable->setToolTip(CMakeBuilderSettings::self()->cmakeExecutableItem()->whatsThis());
m_prefsUi->label1->setToolTip(CMakeBuilderSettings::self()->cmakeExecutableItem()->whatsThis());
foreach(const QString& generator, CMakeBuilder::supportedGenerators())
m_prefsUi->kcfg_generator->addItem(generator);
......
......@@ -22,7 +22,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="kcfg_cmakeExe">
<widget class="KUrlRequester" name="kcfg_cmakeExecutable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
......
......@@ -81,7 +81,7 @@ QUrl CMakeJob::workingDirectory() const
QStringList CMakeJob::commandLine() const
{
QStringList args;
args << CMake::currentCMakeBinary( m_project ).toLocalFile();
args << CMake::currentCMakeExecutable(m_project).toLocalFile();
args << "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON";
QString installDir = CMake::currentInstallDir( m_project ).toLocalFile();
......
......@@ -22,8 +22,9 @@
<entry name="numberOfJobs" key="Number Of Jobs" type="UInt">
<default>2</default>
</entry>
<entry name="makeBinary" key="Make Binary" type="String">
<default code="true">MakeBuilderPreferences::standardMakeCommand()</default>
<!-- TODO: migrate to more generic & consistent key term "Make Executable" -->
<entry name="makeExecutable" key="Make Binary" type="String">
<default code="true">MakeBuilderPreferences::standardMakeExecutable()</default>
</entry>
<entry name="defaultTarget" key="Default Target" type="String">
</entry>
......
......@@ -32,9 +32,9 @@ MakeBuilderPreferences::MakeBuilderPreferences(IPlugin* plugin, const ProjectCon
{
m_prefsUi = new Ui::MakeConfig;
m_prefsUi->setupUi(this);
connect(m_prefsUi->makeBinary, &KUrlRequester::textChanged,
connect(m_prefsUi->makeExecutable, &KUrlRequester::textChanged,
this, &MakeBuilderPreferences::changed);
connect(m_prefsUi->makeBinary, &KUrlRequester::urlSelected,
connect(m_prefsUi->makeExecutable, &KUrlRequester::urlSelected,
this, &MakeBuilderPreferences::changed);
connect(m_prefsUi->configureEnvironment, &EnvironmentConfigureButton::environmentConfigured,
this, &MakeBuilderPreferences::changed);
......@@ -45,13 +45,13 @@ MakeBuilderPreferences::MakeBuilderPreferences(IPlugin* plugin, const ProjectCon
void MakeBuilderPreferences::reset()
{
ProjectConfigPage::reset();
QSignalBlocker sigBlock(this); // don't emit changed signal from m_prefsUi->makeBinary
m_prefsUi->makeBinary->setText(MakeBuilderSettings::self()->makeBinary());
QSignalBlocker sigBlock(this); // don't emit changed signal from m_prefsUi->makeExecutable
m_prefsUi->makeExecutable->setText(MakeBuilderSettings::self()->makeExecutable());
}
void MakeBuilderPreferences::apply()
{
MakeBuilderSettings::self()->setMakeBinary(m_prefsUi->makeBinary->text());
MakeBuilderSettings::self()->setMakeExecutable(m_prefsUi->makeExecutable->text());
MakeBuilderSettings::self()->save(); // TODO: is this needed? KConfigDialogManager should end up calling it
ProjectConfigPage::apply();
}
......@@ -59,7 +59,7 @@ void MakeBuilderPreferences::apply()
void MakeBuilderPreferences::defaults()
{
MakeBuilderSettings::self()->setDefaults();
m_prefsUi->makeBinary->setText(MakeBuilderSettings::self()->makeBinary());
m_prefsUi->makeExecutable->setText(MakeBuilderSettings::self()->makeExecutable());
ProjectConfigPage::defaults();
}
......@@ -68,7 +68,7 @@ MakeBuilderPreferences::~MakeBuilderPreferences()
delete m_prefsUi;
}
QString MakeBuilderPreferences::standardMakeCommand()
QString MakeBuilderPreferences::standardMakeExecutable()
{
#ifdef Q_OS_WIN
if (!QStandardPaths::findExecutable("make").isEmpty())
......
......@@ -44,7 +44,7 @@ public:
QString fullName() const override;
QIcon icon() const override;
static QString standardMakeCommand();
static QString standardMakeExecutable();
private:
Ui::MakeConfig* m_prefsUi;
......
......@@ -147,12 +147,12 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>makeBinary</cstring>
<cstring>makeExecutable</cstring>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="KUrlRequester" name="makeBinary">
<widget class="KUrlRequester" name="makeExecutable">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
......
......@@ -206,7 +206,8 @@ QStringList MakeJob::commandLine() const
KSharedConfigPtr configPtr = it->project()->projectConfiguration();
KConfigGroup builderGroup( configPtr, "MakeBuilder" );
QString makeBin = builderGroup.readEntry("Make Binary", MakeBuilderPreferences::standardMakeCommand());
// TODO: migrate to more generic key term "Make Executable"
QString makeBin = builderGroup.readEntry("Make Binary", MakeBuilderPreferences::standardMakeExecutable());
cmdline << makeBin;
if( ! builderGroup.readEntry("Abort on First Error", true))
......
......@@ -37,7 +37,7 @@ K_PLUGIN_FACTORY_WITH_JSON(NinjaBuilderFactory, "kdevninja.json", registerPlugin
KDevNinjaBuilderPlugin::KDevNinjaBuilderPlugin(QObject* parent, const QVariantList& )
: KDevelop::IPlugin("kdevninja", parent)
{
if(NinjaJob::ninjaBinary().isEmpty()) {
if(NinjaJob::ninjaExecutable().isEmpty()) {
setErrorDescription(i18n("Unable to find ninja executable. Is it installed on the system?"));
}
}
......
......@@ -87,7 +87,7 @@ NinjaJob::NinjaJob(KDevelop::ProjectBaseItem* item, const QStringList& arguments
// hardcode the ninja output format so we can parse it reliably
addEnvironmentOverride(QStringLiteral("NINJA_STATUS"), QStringLiteral("[%s/%t] "));
*this << ninjaBinary();
*this << ninjaExecutable();
*this << arguments;
QStringList targets;
......@@ -111,7 +111,7 @@ void NinjaJob::setIsInstalling( bool isInstalling )
m_isInstalling = isInstalling;
}
QString NinjaJob::ninjaBinary()
QString NinjaJob::ninjaExecutable()
{
QString path = QStandardPaths::findExecutable("ninja-build");
if (path.isEmpty()) {
......
......@@ -43,7 +43,7 @@ class NinjaJob : public KDevelop::OutputExecuteJob
NinjaJob( KDevelop::ProjectBaseItem* item, const QStringList& arguments, const QByteArray& signal, KDevNinjaBuilderPlugin* parent );
void setIsInstalling( bool isInstalling );
static QString ninjaBinary();
static QString ninjaExecutable();
KDevelop::ProjectBaseItem* item() const;
......
......@@ -80,7 +80,7 @@ QStringList QMakeJob::commandLine() const
}
QStringList args;
args << QMakeConfig::qmakeBinary(m_project);
args << QMakeConfig::qmakeExecutable(m_project);
args << m_project->path().toUrl().toLocalFile();
......
......@@ -59,11 +59,11 @@ CMakeBuildDirChooser::CMakeBuildDirChooser(QWidget* parent)
m_chooserUi->buildFolder->setMode(KFile::Directory|KFile::ExistingOnly);
m_chooserUi->installPrefix->setMode(KFile::Directory|KFile::ExistingOnly);
setCMakeBinary(Path(CMake::findExecutable()));
setCMakeExecutable(Path(CMake::findExecutable()));
m_extraArgumentsHistory = new CMakeExtraArgumentsHistory(m_chooserUi->extraArguments);
connect(m_chooserUi->cmakeBin, &KUrlRequester::textChanged, this, &CMakeBuildDirChooser::updated);
connect(m_chooserUi->cmakeExecutable, &KUrlRequester::textChanged, this, &CMakeBuildDirChooser::updated);
connect(m_chooserUi->buildFolder, &KUrlRequester::textChanged, this, &CMakeBuildDirChooser::updated);
connect(m_chooserUi->buildType, static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, &CMakeBuildDirChooser::updated);
connect(m_chooserUi->extraArguments, &KComboBox::editTextChanged, this, &CMakeBuildDirChooser::updated);
......@@ -142,7 +142,7 @@ void CMakeBuildDirChooser::buildDirSettings(
void CMakeBuildDirChooser::updated()
{
bool haveCMake=QFile::exists(m_chooserUi->cmakeBin->url().toLocalFile());
bool haveCMake=QFile::exists(m_chooserUi->cmakeExecutable->url().toLocalFile());
StatusTypes st;
if( haveCMake ) st |= HaveCMake;
......@@ -152,7 +152,7 @@ void CMakeBuildDirChooser::updated()
// m_chooserUi->generator->setEnabled(haveCMake);
if(!haveCMake)
{
setStatus(i18n("You need to select a cmake binary."), false);
setStatus(i18n("You need to select a CMake executable."), false);
return;
}
......@@ -244,9 +244,9 @@ void CMakeBuildDirChooser::updated()
}
}
void CMakeBuildDirChooser::setCMakeBinary(const Path& path)
void CMakeBuildDirChooser::setCMakeExecutable(const Path& path)
{
m_chooserUi->cmakeBin->setUrl(path.toUrl());
m_chooserUi->cmakeExecutable->setUrl(path.toUrl());
updated();
}
......@@ -300,7 +300,7 @@ void CMakeBuildDirChooser::setStatus(const QString& message, bool canApply)
}
}
Path CMakeBuildDirChooser::cmakeBinary() const { return Path(m_chooserUi->cmakeBin->url()); }
Path CMakeBuildDirChooser::cmakeExecutable() const { return Path(m_chooserUi->cmakeExecutable->url()); }
Path CMakeBuildDirChooser::installPrefix() const { return Path(m_chooserUi->installPrefix->url()); }
......
......@@ -53,13 +53,13 @@ class KDEVCMAKECOMMON_EXPORT CMakeBuildDirChooser : public QDialog
explicit CMakeBuildDirChooser(QWidget* parent = nullptr);
~CMakeBuildDirChooser() override;
KDevelop::Path cmakeBinary() const;
KDevelop::Path cmakeExecutable() const;
KDevelop::Path installPrefix() const;
KDevelop::Path buildFolder() const;
QString buildType() const;
QString extraArguments() const;
void setCMakeBinary(const KDevelop::Path& path);
void setCMakeExecutable(const KDevelop::Path& path);
void setInstallPrefix(const KDevelop::Path& path);
void setBuildFolder(const KDevelop::Path& path);
void setBuildType(const QString& buildType);
......
......@@ -26,18 +26,18 @@
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>CMake &amp;Binary:</string>
<string>CMake &amp;executable:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>cmakeBin</cstring>
<cstring>cmakeExecutable</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="cmakeBin">
<widget class="KUrlRequester" name="cmakeExecutable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
......
......@@ -49,11 +49,11 @@ KDevelop::IDocumentationProvider* CMakeDoc::provider() const { return s_provider
CMakeDocumentation::CMakeDocumentation(QObject* parent, const QVariantList&)
: KDevelop::IPlugin( "kdevcmakedocumentation", parent )
, mCMakeCmd(CMake::findExecutable())
, m_cmakeExecutable(CMake::findExecutable())
, m_index(nullptr)
{
if (mCMakeCmd.isEmpty()) {
setErrorDescription(i18n("Unable to find cmake executable. Is it installed on the system?") );
if (m_cmakeExecutable.isEmpty()) {
setErrorDescription(i18n("Unable to find a CMake executable. Is one installed on the system?"));
return;
}
......@@ -75,7 +75,7 @@ void CMakeDocumentation::delayedInitialization()
void CMakeDocumentation::collectIds(const QString& param, Type type)
{
QStringList ids=CMake::executeProcess(mCMakeCmd, QStringList(param)).split('\n');
QStringList ids = CMake::executeProcess(m_cmakeExecutable, QStringList(param)).split(QLatin1Char('\n'));
ids.takeFirst();
foreach(const QString& name, ids)
{
......@@ -92,7 +92,7 @@ QString CMakeDocumentation::descriptionForIdentifier(const QString& id, Type t)
{
QString desc;
if(args[t]) {
desc = CMake::executeProcess(mCMakeCmd, { args[t], id.simplified() });
desc = CMake::executeProcess(m_cmakeExecutable, { args[t], id.simplified() });
desc = desc.remove(":ref:");
const QString rst2html = QStandardPaths::findExecutable(QStringLiteral("rst2html"));
......
......@@ -65,7 +65,7 @@ class CMakeDocumentation : public KDevelop::IPlugin, public ICMakeDocumentation
void collectIds(const QString& param, Type type);
QMap<QString, Type> m_typeForName;
const QString mCMakeCmd;
const QString m_cmakeExecutable;
QStringListModel* m_index;
};
......
......@@ -85,7 +85,7 @@ CMakeManager::CMakeManager( QObject* parent, const QVariantList& )
, m_filter( new ProjectFilterManager( this ) )
{
if (CMake::findExecutable().isEmpty()) {
setErrorDescription(i18n("Unable to find cmake executable. Is it installed on the system?"));
setErrorDescription(i18n("Unable to find a CMake executable. Is one installed on the system?"));
m_highlight = nullptr;
return;
}
......
......@@ -66,7 +66,8 @@ static const QString buildDirCountKey = "Build Directory Count";
namespace Specific
{
static const QString buildDirPathKey = "Build Directory Path";
static const QString cmakeBinKey = "CMake Binary";
// TODO: migrate to more generic & consistent key term "CMake Executable"
static const QString cmakeExecutableKey = "CMake Binary";
static const QString cmakeBuildTypeKey = "Build Type";
static const QString cmakeInstallDirKey = "Install Directory";
static const QString cmakeEnvironmentKey = "Environment Profile";
......@@ -193,7 +194,7 @@ bool checkForNeedingConfigure( KDevelop::IProject* project )
bd.setSourceFolder( folder );
bd.setAlreadyUsed( CMake::allBuildDirs(project) );
bd.setCMakeBinary( currentCMakeBinary(project) );
bd.setCMakeExecutable(currentCMakeExecutable(project));
if( !bd.exec() )
{
......@@ -210,7 +211,7 @@ bool checkForNeedingConfigure( KDevelop::IProject* project )
qCDebug(CMAKE) << "adding to cmake config: installdir " << bd.installPrefix();
qCDebug(CMAKE) << "adding to cmake config: extra args" << bd.extraArguments();
qCDebug(CMAKE) << "adding to cmake config: build type " << bd.buildType();
qCDebug(CMAKE) << "adding to cmake config: cmake binary " << bd.cmakeBinary();
qCDebug(CMAKE) << "adding to cmake config: cmake executable " << bd.cmakeExecutable();
qCDebug(CMAKE) << "adding to cmake config: environment <null>";
CMake::setBuildDirCount( project, addedBuildDirIndex + 1 );
CMake::setCurrentBuildDirIndex( project, addedBuildDirIndex );
......@@ -218,7 +219,7 @@ bool checkForNeedingConfigure( KDevelop::IProject* project )
CMake::setCurrentInstallDir( project, bd.installPrefix() );
CMake::setCurrentExtraArguments( project, bd.extraArguments() );
CMake::setCurrentBuildType( project, bd.buildType() );
CMake::setCurrentCMakeBinary( project, bd.cmakeBinary() );
CMake::setCurrentCMakeExecutable(project, bd.cmakeExecutable());
CMake::setCurrentEnvironment( project, QString() );
return true;
......@@ -308,14 +309,14 @@ QString findExecutable()
return cmake;
}
KDevelop::Path currentCMakeBinary( KDevelop::IProject* project )
KDevelop::Path currentCMakeExecutable(KDevelop::IProject* project)
{
const auto systemBinary = findExecutable();
auto path = readProjectParameter( project, Config::Specific::cmakeBinKey, systemBinary );
if (path != systemBinary) {
const auto systemExecutable = findExecutable();
auto path = readProjectParameter(project, Config::Specific::cmakeExecutableKey, systemExecutable);
if (path != systemExecutable) {
QFileInfo info(path);
if (!info.isExecutable()) {
path = systemBinary;
path = systemExecutable;
}
}
return KDevelop::Path(path);
......@@ -351,9 +352,9 @@ void setCurrentBuildType( KDevelop::IProject* project, const QString& type )
writeProjectParameter( project, Config::Specific::cmakeBuildTypeKey, type );
}
void setCurrentCMakeBinary( KDevelop::IProject* project, const KDevelop::Path& path )
void setCurrentCMakeExecutable(KDevelop::IProject* project, const KDevelop::Path& path)
{
writeProjectParameter( project, Config::Specific::cmakeBinKey, path.toLocalFile() );
writeProjectParameter(project, Config::Specific::cmakeExecutableKey, path.toLocalFile());
}
void setCurrentBuildDir( KDevelop::IProject* project, const KDevelop::Path& path )
......@@ -454,7 +455,7 @@ void updateConfig( KDevelop::IProject* project, int buildDirIndex)
const KDevelop::Path cacheFilePath( builddir, QStringLiteral("CMakeCache.txt"));
QFile file(cacheFilePath.toLocalFile());
const QMap<QString, QString> keys = {
{ Config::Specific::cmakeBinKey, QStringLiteral("CMAKE_COMMAND") },
{ Config::Specific::cmakeExecutableKey, QStringLiteral("CMAKE_COMMAND") },
{ Config::Specific::cmakeInstallDirKey, QStringLiteral("CMAKE_INSTALL_PREFIX") },
{ Config::Specific::cmakeBuildTypeKey, QStringLiteral("CMAKE_BUILD_TYPE") }
};
......
......@@ -70,15 +70,15 @@ namespace CMake
KDEVCMAKECOMMON_EXPORT QString currentBuildType( KDevelop::IProject* project );
/**
* @returns the cmake executable, taking into account standard
* @returns the CMake executable, taking into account standard
* installation dirs on Windows, or empty string in case of failure.
*/
KDEVCMAKECOMMON_EXPORT QString findExecutable();
/**
* @returns the current cmake binary for the given project or
* @returns the current CMake executable for the given project or
* QStandardPaths::findExecutable("cmake") as default value.
*/
KDEVCMAKECOMMON_EXPORT KDevelop::Path currentCMakeBinary( KDevelop::IProject* project );
KDEVCMAKECOMMON_EXPORT KDevelop::Path currentCMakeExecutable(KDevelop::IProject* project);
/**
* @returns the current install dir for the given project or "/usr/local" as default value.
......@@ -126,9 +126,9 @@ namespace CMake
KDEVCMAKECOMMON_EXPORT void setCurrentBuildType( KDevelop::IProject* project, const QString& type );
/**
* Sets the current cmake binary for the given project.
* Sets the current CMake executable for the given project.
*/
KDEVCMAKECOMMON_EXPORT void setCurrentCMakeBinary( KDevelop::IProject* project, const KDevelop::Path &path );
KDEVCMAKECOMMON_EXPORT void setCurrentCMakeExecutable(KDevelop::IProject* project, const KDevelop::Path& path);
/**
* Sets the current build dir for the given project.
......
......@@ -212,12 +212,12 @@
</widget>
</item>
<item row="4" column="1">
<widget class="KUrlRequester" name="cMakeBinary"/>
<widget class="KUrlRequester" name="cMakeExecutable"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="cMakeBinaryLabel">
<widget class="QLabel">