forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/master' into 4.10
Change-Id: I4dcea93f555e2d39fbe7680a1e14cca73be14cf1
This commit is contained in:
@@ -50,10 +50,12 @@ endif()
|
|||||||
|
|
||||||
find_package(Qt5
|
find_package(Qt5
|
||||||
COMPONENTS Concurrent Core Network PrintSupport Qml Quick QuickWidgets
|
COMPONENTS Concurrent Core Network PrintSupport Qml Quick QuickWidgets
|
||||||
Script Sql ${_TEST_QT_COMPONENT}
|
Sql ${_TEST_QT_COMPONENT}
|
||||||
REQUIRED
|
REQUIRED
|
||||||
)
|
)
|
||||||
|
|
||||||
|
find_package(Threads)
|
||||||
|
|
||||||
# Get information on directories from qmake
|
# Get information on directories from qmake
|
||||||
# as this is not yet exported by cmake.
|
# as this is not yet exported by cmake.
|
||||||
function(qt5_query_qmake)
|
function(qt5_query_qmake)
|
||||||
@@ -88,7 +90,7 @@ endfunction()
|
|||||||
|
|
||||||
qt5_query_qmake()
|
qt5_query_qmake()
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Designer Help SerialPort Svg QUIET)
|
find_package(Qt5 COMPONENTS Designer Help Script SerialPort Svg QUIET)
|
||||||
function (set_if_target var target)
|
function (set_if_target var target)
|
||||||
if (TARGET "${target}")
|
if (TARGET "${target}")
|
||||||
set(_result ON)
|
set(_result ON)
|
||||||
|
@@ -1,9 +1,22 @@
|
|||||||
install(
|
set(template_directories cplusplus debugger glsl modeleditor qml qmldesigner
|
||||||
DIRECTORY cplusplus debugger glsl modeleditor qml qmldesigner
|
qmlicons qml-type-descriptions schemes snippets styles templates themes welcomescreen)
|
||||||
qmlicons qml-type-descriptions schemes snippets styles templates themes welcomescreen
|
|
||||||
DESTINATION "${IDE_DATA_PATH}"
|
add_custom_target(copy_share_to_builddir ALL
|
||||||
|
COMMENT Copy files into build directory
|
||||||
|
VERBATIM
|
||||||
)
|
)
|
||||||
|
|
||||||
|
foreach(dir IN ITEMS ${template_directories})
|
||||||
|
add_custom_command(TARGET copy_share_to_builddir POST_BUILD
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${dir}"
|
||||||
|
"${PROJECT_BINARY_DIR}/${IDE_DATA_PATH}/${dir}"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
COMMENT Copy files into build directory
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
install(DIRECTORY ${template_directories} DESTINATION "${IDE_DATA_PATH}")
|
||||||
install(
|
install(
|
||||||
FILES indexer_preincludes/qglobal.h indexer_preincludes/windows.h
|
FILES indexer_preincludes/qglobal.h indexer_preincludes/windows.h
|
||||||
DESTINATION "${IDE_DATA_PATH}/indexer_preincludes"
|
DESTINATION "${IDE_DATA_PATH}/indexer_preincludes"
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
@if '%{QtModule}' === 'none'
|
@if '%{QtModule}' === 'none'
|
||||||
QT -= core
|
CONFIG -= qt
|
||||||
@elsif '%{QtModule}' === 'core'
|
@elsif '%{QtModule}' === 'core'
|
||||||
QT -= gui
|
QT -= gui
|
||||||
@else
|
@else
|
||||||
|
@@ -23,12 +23,12 @@
|
|||||||
{ "key": "PluginInterface", "value": "%{JS: value('BaseClassInfo').PluginInterface }" },
|
{ "key": "PluginInterface", "value": "%{JS: value('BaseClassInfo').PluginInterface }" },
|
||||||
{ "key": "PluginModule", "value": "%{JS: value('BaseClassInfo').PluginModule }" },
|
{ "key": "PluginModule", "value": "%{JS: value('BaseClassInfo').PluginModule }" },
|
||||||
{ "key": "PluginMethods", "value": "%{JS: value('BaseClassInfo').PluginMethods }" },
|
{ "key": "PluginMethods", "value": "%{JS: value('BaseClassInfo').PluginMethods }" },
|
||||||
{ "key": "QtModule", "value": "%{JS: value('IsQtPlugin') ? value('PluginModule') : value('LibraryQtModule')}" },
|
{ "key": "QtModule", "value": "%{JS: value('IsQtPlugin') === 'true' ? value('PluginModule') : value('LibraryQtModule')}" },
|
||||||
{ "key": "QtModuleUpperCase", "value": "%{JS: value('QtModule').charAt(0).toUpperCase() + value('QtModule').slice(1)}" },
|
{ "key": "QtModuleUpperCase", "value": "%{JS: value('QtModule').charAt(0).toUpperCase() + value('QtModule').slice(1)}" },
|
||||||
{ "key": "LibraryDefine", "value": "%{JS: Cpp.headerGuard(value('ProjectName')) + '_LIBRARY'}" },
|
{ "key": "LibraryDefine", "value": "%{JS: Cpp.headerGuard(value('ProjectName')) + '_LIBRARY'}" },
|
||||||
{ "key": "LibraryExport", "value": "%{JS: Cpp.headerGuard(value('ProjectName')) + '_EXPORT'}" },
|
{ "key": "LibraryExport", "value": "%{JS: Cpp.headerGuard(value('ProjectName')) + '_EXPORT'}" },
|
||||||
{ "key": "GlobalHdrFileName", "value": "%{JS: Util.fileName(value('ProjectName') + '_global', Util.preferredSuffix('text/x-c++hdr'))}" },
|
{ "key": "GlobalHdrFileName", "value": "%{JS: Util.fileName(value('ProjectName') + '_global', Util.preferredSuffix('text/x-c++hdr'))}" },
|
||||||
{ "key": "TargetInstallPath", "value": "%{JS: value('IsShared') ? '/usr/lib' : (value('IsQtPlugin') && value('PluginTargetPath') ? '$$[QT_INSTALL_PLUGINS]/' + value('PluginTargetPath') : '')}" },
|
{ "key": "TargetInstallPath", "value": "%{JS: value('IsShared') === 'true' ? '/usr/lib' : (value('IsQtPlugin') && value('PluginTargetPath') ? '$$[QT_INSTALL_PLUGINS]/' + value('PluginTargetPath') : '')}" },
|
||||||
{ "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" },
|
{ "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" },
|
||||||
{ "key": "GUARD", "value": "%{JS: Cpp.headerGuard(value('HdrFileName'))}" },
|
{ "key": "GUARD", "value": "%{JS: Cpp.headerGuard(value('HdrFileName'))}" },
|
||||||
{ "key": "GLOBAL_GUARD", "value": "%{JS: Cpp.headerGuard(value('GlobalHdrFileName'))}" }
|
{ "key": "GLOBAL_GUARD", "value": "%{JS: Cpp.headerGuard(value('GlobalHdrFileName'))}" }
|
||||||
|
@@ -486,6 +486,10 @@ function(fix_test_environment test_name)
|
|||||||
list(APPEND env_path $ENV{PATH})
|
list(APPEND env_path $ENV{PATH})
|
||||||
list(APPEND env_path ${CMAKE_BINARY_DIR}/${IDE_PLUGIN_PATH})
|
list(APPEND env_path ${CMAKE_BINARY_DIR}/${IDE_PLUGIN_PATH})
|
||||||
list(APPEND env_path ${CMAKE_BINARY_DIR}/${IDE_BIN_PATH})
|
list(APPEND env_path ${CMAKE_BINARY_DIR}/${IDE_BIN_PATH})
|
||||||
|
list(APPEND env_path $<TARGET_FILE_DIR:Qt5::Test>)
|
||||||
|
if (TARGET libclang)
|
||||||
|
list(APPEND env_path $<TARGET_FILE_DIR:libclang>)
|
||||||
|
endif()
|
||||||
|
|
||||||
string(REPLACE "/" "\\" env_path "${env_path}")
|
string(REPLACE "/" "\\" env_path "${env_path}")
|
||||||
string(REPLACE ";" "\\;" env_path "${env_path}")
|
string(REPLACE ";" "\\;" env_path "${env_path}")
|
||||||
|
@@ -33,11 +33,6 @@ if (WIN32)
|
|||||||
target_sources(qtcreator PRIVATE qtcreator.rc)
|
target_sources(qtcreator PRIVATE qtcreator.rc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_custom_command(TARGET qtcreator POST_BUILD
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
|
||||||
"${PROJECT_SOURCE_DIR}/share/qtcreator"
|
|
||||||
"${PROJECT_BINARY_DIR}/${IDE_DATA_PATH}")
|
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set_target_properties(qtcreator PROPERTIES
|
set_target_properties(qtcreator PROPERTIES
|
||||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/app-Info.plist"
|
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/app-Info.plist"
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "algorithm.h"
|
#include "algorithm.h"
|
||||||
#include "qtcassert.h"
|
#include "qtcassert.h"
|
||||||
|
#include "qtcprocess.h"
|
||||||
|
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -66,6 +67,33 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
|
/*! \class Utils::CommandLine
|
||||||
|
|
||||||
|
\brief The CommandLine class represents a command line of a QProcess
|
||||||
|
or similar utility.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
void CommandLine::addArg(const QString &arg)
|
||||||
|
{
|
||||||
|
QtcProcess::addArg(&m_arguments, arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CommandLine::addArgs(const QStringList &inArgs)
|
||||||
|
{
|
||||||
|
QtcProcess::addArgs(&m_arguments, inArgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CommandLine::addArgs(const QString &inArgs)
|
||||||
|
{
|
||||||
|
QtcProcess::addArgs(&m_arguments, inArgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString CommandLine::toUserOutput() const
|
||||||
|
{
|
||||||
|
return m_executable.toUserOutput() + ' ' + m_arguments;
|
||||||
|
}
|
||||||
|
|
||||||
/*! \class Utils::FileUtils
|
/*! \class Utils::FileUtils
|
||||||
|
|
||||||
\brief The FileUtils class contains file and directory related convenience
|
\brief The FileUtils class contains file and directory related convenience
|
||||||
|
@@ -128,6 +128,29 @@ using FilePathList = QList<FilePath>;
|
|||||||
using FileName = FilePath;
|
using FileName = FilePath;
|
||||||
using FileNameList = FilePathList;
|
using FileNameList = FilePathList;
|
||||||
|
|
||||||
|
class QTCREATOR_UTILS_EXPORT CommandLine
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CommandLine() {}
|
||||||
|
|
||||||
|
CommandLine(const FilePath &executable, const QString &arguments)
|
||||||
|
: m_executable(executable), m_arguments(arguments)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void addArg(const QString &arg);
|
||||||
|
void addArgs(const QStringList &inArgs);
|
||||||
|
void addArgs(const QString &inArgs);
|
||||||
|
|
||||||
|
QString toUserOutput() const;
|
||||||
|
|
||||||
|
FilePath executable() const { return m_executable; }
|
||||||
|
QString arguments() const { return m_arguments; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
FilePath m_executable;
|
||||||
|
QString m_arguments;
|
||||||
|
};
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT FileUtils {
|
class QTCREATOR_UTILS_EXPORT FileUtils {
|
||||||
public:
|
public:
|
||||||
static bool removeRecursively(const FilePath &filePath, QString *error = nullptr);
|
static bool removeRecursively(const FilePath &filePath, QString *error = nullptr);
|
||||||
|
@@ -1521,24 +1521,4 @@ QString QtcProcess::Arguments::toString() const
|
|||||||
return QtcProcess::joinArgs(m_unixArgs, OsTypeLinux);
|
return QtcProcess::joinArgs(m_unixArgs, OsTypeLinux);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandLine::addArg(const QString &arg)
|
|
||||||
{
|
|
||||||
QtcProcess::addArg(&m_arguments, arg);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CommandLine::addArgs(const QStringList &inArgs)
|
|
||||||
{
|
|
||||||
QtcProcess::addArgs(&m_arguments, inArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CommandLine::addArgs(const QString &inArgs)
|
|
||||||
{
|
|
||||||
QtcProcess::addArgs(&m_arguments, inArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CommandLine::toUserOutput() const
|
|
||||||
{
|
|
||||||
return m_executable.toUserOutput() + ' ' + m_arguments;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
|
@@ -32,29 +32,6 @@
|
|||||||
namespace Utils {
|
namespace Utils {
|
||||||
class AbstractMacroExpander;
|
class AbstractMacroExpander;
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT CommandLine
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CommandLine() {}
|
|
||||||
|
|
||||||
CommandLine(const FilePath &executable, const QString &arguments)
|
|
||||||
: m_executable(executable), m_arguments(arguments)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void addArg(const QString &arg);
|
|
||||||
void addArgs(const QStringList &inArgs);
|
|
||||||
void addArgs(const QString &inArgs);
|
|
||||||
|
|
||||||
QString toUserOutput() const;
|
|
||||||
|
|
||||||
FilePath executable() const { return m_executable; }
|
|
||||||
QString arguments() const { return m_arguments; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
FilePath m_executable;
|
|
||||||
QString m_arguments;
|
|
||||||
};
|
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT QtcProcess : public QProcess
|
class QTCREATOR_UTILS_EXPORT QtcProcess : public QProcess
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@@ -300,7 +300,7 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy()
|
|||||||
{
|
{
|
||||||
CommandLine cmd(Utils::FilePath::fromString(m_command), {});
|
CommandLine cmd(Utils::FilePath::fromString(m_command), {});
|
||||||
if (m_useAndroiddeployqt && m_apkPath.isEmpty()) {
|
if (m_useAndroiddeployqt && m_apkPath.isEmpty()) {
|
||||||
cmd = m_androiddeployqtArgs;
|
cmd.addArgs(m_androiddeployqtArgs.arguments());
|
||||||
if (m_uninstallPreviousPackageRun)
|
if (m_uninstallPreviousPackageRun)
|
||||||
cmd.addArg("--install");
|
cmd.addArg("--install");
|
||||||
else
|
else
|
||||||
|
@@ -205,8 +205,6 @@ bool CMakeBuildStep::init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString arguments = allArguments(rc);
|
|
||||||
|
|
||||||
setIgnoreReturnValue(m_buildTarget == CMakeBuildStep::cleanTarget());
|
setIgnoreReturnValue(m_buildTarget == CMakeBuildStep::cleanTarget());
|
||||||
|
|
||||||
ProcessParameters *pp = processParameters();
|
ProcessParameters *pp = processParameters();
|
||||||
@@ -217,8 +215,7 @@ bool CMakeBuildStep::init()
|
|||||||
env.set("NINJA_STATUS", m_ninjaProgressString + "%o/sec] ");
|
env.set("NINJA_STATUS", m_ninjaProgressString + "%o/sec] ");
|
||||||
pp->setEnvironment(env);
|
pp->setEnvironment(env);
|
||||||
pp->setWorkingDirectory(bc->buildDirectory());
|
pp->setWorkingDirectory(bc->buildDirectory());
|
||||||
pp->setCommand(cmakeCommand());
|
pp->setCommandLine(cmakeCommand(rc));
|
||||||
pp->setArguments(arguments);
|
|
||||||
pp->resolveAll();
|
pp->resolveAll();
|
||||||
|
|
||||||
setOutputParser(new CMakeParser);
|
setOutputParser(new CMakeParser);
|
||||||
@@ -342,12 +339,12 @@ void CMakeBuildStep::setToolArguments(const QString &list)
|
|||||||
m_toolArguments = list;
|
m_toolArguments = list;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CMakeBuildStep::allArguments(const CMakeRunConfiguration *rc) const
|
Utils::CommandLine CMakeBuildStep::cmakeCommand(CMakeRunConfiguration *rc) const
|
||||||
{
|
{
|
||||||
QString arguments;
|
CMakeTool *tool = CMakeKitAspect::cmakeTool(target()->kit());
|
||||||
|
|
||||||
Utils::QtcProcess::addArg(&arguments, "--build");
|
Utils::CommandLine cmd(tool ? tool->cmakeExecutable() : Utils::FilePath(), {});
|
||||||
Utils::QtcProcess::addArg(&arguments, ".");
|
cmd.addArgs({"--build", "."});
|
||||||
|
|
||||||
QString target;
|
QString target;
|
||||||
|
|
||||||
@@ -360,21 +357,14 @@ QString CMakeBuildStep::allArguments(const CMakeRunConfiguration *rc) const
|
|||||||
target = m_buildTarget;
|
target = m_buildTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::QtcProcess::addArg(&arguments, "--target");
|
cmd.addArgs({"--target", target});
|
||||||
Utils::QtcProcess::addArg(&arguments, target);
|
|
||||||
|
|
||||||
if (!m_toolArguments.isEmpty()) {
|
if (!m_toolArguments.isEmpty()) {
|
||||||
Utils::QtcProcess::addArg(&arguments, "--");
|
cmd.addArg("--");
|
||||||
arguments += ' ' + m_toolArguments;
|
cmd.addArgs(m_toolArguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
return arguments;
|
return cmd;
|
||||||
}
|
|
||||||
|
|
||||||
Utils::FilePath CMakeBuildStep::cmakeCommand() const
|
|
||||||
{
|
|
||||||
CMakeTool *tool = CMakeKitAspect::cmakeTool(target()->kit());
|
|
||||||
return tool ? tool->cmakeExecutable() : Utils::FilePath();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CMakeBuildStep::cleanTarget()
|
QString CMakeBuildStep::cleanTarget()
|
||||||
@@ -530,8 +520,7 @@ void CMakeBuildStepConfigWidget::updateDetails()
|
|||||||
param.setMacroExpander(bc->macroExpander());
|
param.setMacroExpander(bc->macroExpander());
|
||||||
param.setEnvironment(bc->environment());
|
param.setEnvironment(bc->environment());
|
||||||
param.setWorkingDirectory(bc->buildDirectory());
|
param.setWorkingDirectory(bc->buildDirectory());
|
||||||
param.setCommand(m_buildStep->cmakeCommand());
|
param.setCommandLine(m_buildStep->cmakeCommand(nullptr));
|
||||||
param.setArguments(m_buildStep->allArguments(nullptr));
|
|
||||||
|
|
||||||
setSummaryText(param.summary(displayName()));
|
setSummaryText(param.summary(displayName()));
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,10 @@ class QListWidget;
|
|||||||
class QListWidgetItem;
|
class QListWidgetItem;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Utils { class PathChooser; }
|
namespace Utils {
|
||||||
|
class CommandLine;
|
||||||
|
class PathChooser;
|
||||||
|
} // Utils
|
||||||
|
|
||||||
namespace ProjectExplorer { class ToolChain; }
|
namespace ProjectExplorer { class ToolChain; }
|
||||||
|
|
||||||
@@ -64,9 +67,7 @@ public:
|
|||||||
QString toolArguments() const;
|
QString toolArguments() const;
|
||||||
void setToolArguments(const QString &list);
|
void setToolArguments(const QString &list);
|
||||||
|
|
||||||
QString allArguments(const CMakeRunConfiguration *rc) const;
|
Utils::CommandLine cmakeCommand(CMakeRunConfiguration *rc) const;
|
||||||
|
|
||||||
Utils::FilePath cmakeCommand() const;
|
|
||||||
|
|
||||||
QVariantMap toMap() const override;
|
QVariantMap toMap() const override;
|
||||||
|
|
||||||
|
@@ -54,6 +54,7 @@
|
|||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
|
||||||
@@ -635,7 +636,8 @@ MakeInstallCommand CMakeProject::makeInstallCommand(const Target *target,
|
|||||||
if (const BuildConfiguration * const bc = target->activeBuildConfiguration()) {
|
if (const BuildConfiguration * const bc = target->activeBuildConfiguration()) {
|
||||||
if (const auto cmakeStep = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
if (const auto cmakeStep = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
||||||
->firstOfType<CMakeBuildStep>()) {
|
->firstOfType<CMakeBuildStep>()) {
|
||||||
cmd.command = cmakeStep->cmakeCommand();
|
if (CMakeTool *tool = CMakeKitAspect::cmakeTool(target->kit()))
|
||||||
|
cmd.command = tool->cmakeExecutable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmd.arguments << "--build" << "." << "--target" << "install";
|
cmd.arguments << "--build" << "." << "--target" << "install";
|
||||||
|
@@ -92,7 +92,7 @@ ServerMode::ServerMode(const Environment &env,
|
|||||||
m_socketDir("/tmp/cmake-"),
|
m_socketDir("/tmp/cmake-"),
|
||||||
#endif
|
#endif
|
||||||
m_sourceDirectory(sourceDirectory), m_buildDirectory(buildDirectory),
|
m_sourceDirectory(sourceDirectory), m_buildDirectory(buildDirectory),
|
||||||
m_cmakeExecutable(cmakeExecutable),
|
m_cmakeCommand(cmakeExecutable, {}),
|
||||||
m_generator(generator), m_extraGenerator(extraGenerator),
|
m_generator(generator), m_extraGenerator(extraGenerator),
|
||||||
m_platform(platform), m_toolset(toolset),
|
m_platform(platform), m_toolset(toolset),
|
||||||
m_useExperimental(experimental), m_majorProtocol(major), m_minorProtocol(minor)
|
m_useExperimental(experimental), m_majorProtocol(major), m_minorProtocol(minor)
|
||||||
@@ -114,28 +114,24 @@ ServerMode::ServerMode(const Environment &env,
|
|||||||
m_socketName = QString::fromLatin1("\\\\.\\pipe\\") + QUuid::createUuid().toString();
|
m_socketName = QString::fromLatin1("\\\\.\\pipe\\") + QUuid::createUuid().toString();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const QStringList args = QStringList({"-E", "server", "--pipe=" + m_socketName});
|
|
||||||
|
|
||||||
connect(m_cmakeProcess.get(), &QtcProcess::started, this, [this]() { m_connectionTimer.start(); });
|
connect(m_cmakeProcess.get(), &QtcProcess::started, this, [this]() { m_connectionTimer.start(); });
|
||||||
connect(m_cmakeProcess.get(),
|
connect(m_cmakeProcess.get(),
|
||||||
QOverload<int, QProcess::ExitStatus>::of(&QtcProcess::finished),
|
QOverload<int, QProcess::ExitStatus>::of(&QtcProcess::finished),
|
||||||
this, &ServerMode::handleCMakeFinished);
|
this, &ServerMode::handleCMakeFinished);
|
||||||
|
|
||||||
QString argumentString;
|
m_cmakeCommand.addArgs({"-E", "server", "--pipe=" + m_socketName});
|
||||||
QtcProcess::addArgs(&argumentString, args);
|
|
||||||
if (m_useExperimental)
|
if (m_useExperimental)
|
||||||
QtcProcess::addArg(&argumentString, "--experimental");
|
m_cmakeCommand.addArg("--experimental");
|
||||||
|
|
||||||
qCInfo(cmakeServerMode)
|
qCInfo(cmakeServerMode)
|
||||||
<< "Preparing cmake:" << cmakeExecutable.toString() << argumentString
|
<< "Preparing cmake:" << m_cmakeCommand.toUserOutput()
|
||||||
<< "in" << m_buildDirectory.toString();
|
<< "in" << m_buildDirectory.toString();
|
||||||
m_cmakeProcess->setCommand(CommandLine(cmakeExecutable, argumentString));
|
m_cmakeProcess->setCommand(m_cmakeCommand);
|
||||||
|
|
||||||
// Delay start:
|
// Delay start:
|
||||||
QTimer::singleShot(0, this, [argumentString, this] {
|
QTimer::singleShot(0, this, [this] {
|
||||||
emit message(tr("Running \"%1 %2\" in %3.")
|
emit message(tr("Running \"%1\" in %2.")
|
||||||
.arg(m_cmakeExecutable.toUserOutput())
|
.arg(m_cmakeCommand.toUserOutput())
|
||||||
.arg(argumentString)
|
|
||||||
.arg(m_buildDirectory.toUserOutput()));
|
.arg(m_buildDirectory.toUserOutput()));
|
||||||
|
|
||||||
m_cmakeProcess->start();
|
m_cmakeProcess->start();
|
||||||
@@ -199,7 +195,7 @@ void ServerMode::connectToServer()
|
|||||||
m_cmakeProcess->disconnect();
|
m_cmakeProcess->disconnect();
|
||||||
qCInfo(cmakeServerMode) << "Timeout waiting for pipe" << m_socketName;
|
qCInfo(cmakeServerMode) << "Timeout waiting for pipe" << m_socketName;
|
||||||
reportError(tr("Running \"%1\" failed: Timeout waiting for pipe \"%2\".")
|
reportError(tr("Running \"%1\" failed: Timeout waiting for pipe \"%2\".")
|
||||||
.arg(m_cmakeExecutable.toUserOutput())
|
.arg(m_cmakeCommand.toUserOutput())
|
||||||
.arg(m_socketName));
|
.arg(m_socketName));
|
||||||
|
|
||||||
Core::Reaper::reap(m_cmakeProcess.release());
|
Core::Reaper::reap(m_cmakeProcess.release());
|
||||||
@@ -236,14 +232,14 @@ void ServerMode::handleCMakeFinished(int code, QProcess::ExitStatus status)
|
|||||||
qCInfo(cmakeServerMode) << "CMake has finished" << code << status;
|
qCInfo(cmakeServerMode) << "CMake has finished" << code << status;
|
||||||
QString msg;
|
QString msg;
|
||||||
if (status != QProcess::NormalExit)
|
if (status != QProcess::NormalExit)
|
||||||
msg = tr("CMake process \"%1\" crashed.").arg(m_cmakeExecutable.toUserOutput());
|
msg = tr("CMake process \"%1\" crashed.").arg(m_cmakeCommand.toUserOutput());
|
||||||
else if (code != 0)
|
else if (code != 0)
|
||||||
msg = tr("CMake process \"%1\" quit with exit code %2.").arg(m_cmakeExecutable.toUserOutput()).arg(code);
|
msg = tr("CMake process \"%1\" quit with exit code %2.").arg(m_cmakeCommand.toUserOutput()).arg(code);
|
||||||
|
|
||||||
if (!msg.isEmpty()) {
|
if (!msg.isEmpty()) {
|
||||||
reportError(msg);
|
reportError(msg);
|
||||||
} else {
|
} else {
|
||||||
emit message(tr("CMake process \"%1\" quit normally.").arg(m_cmakeExecutable.toUserOutput()));
|
emit message(tr("CMake process \"%1\" quit normally.").arg(m_cmakeCommand.toUserOutput()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_cmakeSocket) {
|
if (m_cmakeSocket) {
|
||||||
|
@@ -94,7 +94,7 @@ private:
|
|||||||
|
|
||||||
Utils::FilePath m_sourceDirectory;
|
Utils::FilePath m_sourceDirectory;
|
||||||
Utils::FilePath m_buildDirectory;
|
Utils::FilePath m_buildDirectory;
|
||||||
Utils::FilePath m_cmakeExecutable;
|
Utils::CommandLine m_cmakeCommand;
|
||||||
|
|
||||||
QByteArray m_buffer;
|
QByteArray m_buffer;
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
add_qtc_plugin(Core
|
add_qtc_plugin(Core
|
||||||
DEPENDS Qt5::PrintSupport Qt5::Qml Qt5::Script Qt5::Sql Qt5::Gui Qt5::GuiPrivate
|
DEPENDS Qt5::PrintSupport Qt5::Qml Qt5::Sql Qt5::Gui Qt5::GuiPrivate
|
||||||
PUBLIC_DEPENDS Aggregation ExtensionSystem Utils app_version
|
PUBLIC_DEPENDS Aggregation ExtensionSystem Utils app_version
|
||||||
SOURCES
|
SOURCES
|
||||||
actionmanager/actioncontainer.cpp actionmanager/actioncontainer.h actionmanager/actioncontainer_p.h
|
actionmanager/actioncontainer.cpp actionmanager/actioncontainer.h actionmanager/actioncontainer_p.h
|
||||||
@@ -100,7 +100,6 @@ add_qtc_plugin(Core
|
|||||||
locator/externaltoolsfilter.cpp locator/externaltoolsfilter.h
|
locator/externaltoolsfilter.cpp locator/externaltoolsfilter.h
|
||||||
locator/filesystemfilter.cpp locator/filesystemfilter.h locator/filesystemfilter.ui
|
locator/filesystemfilter.cpp locator/filesystemfilter.h locator/filesystemfilter.ui
|
||||||
locator/ilocatorfilter.cpp locator/ilocatorfilter.h
|
locator/ilocatorfilter.cpp locator/ilocatorfilter.h
|
||||||
locator/javascriptfilter.cpp locator/javascriptfilter.h
|
|
||||||
locator/locator.cpp locator/locator.h
|
locator/locator.cpp locator/locator.h
|
||||||
locator/locatorconstants.h
|
locator/locatorconstants.h
|
||||||
locator/locatorfiltersfilter.cpp locator/locatorfiltersfilter.h
|
locator/locatorfiltersfilter.cpp locator/locatorfiltersfilter.h
|
||||||
@@ -176,3 +175,11 @@ extend_qtc_plugin(Core
|
|||||||
CONDITION (NOT WIN32) AND (NOT APPLE)
|
CONDITION (NOT WIN32) AND (NOT APPLE)
|
||||||
SOURCES progressmanager/progressmanager_x11.cpp
|
SOURCES progressmanager/progressmanager_x11.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
extend_qtc_plugin(Core
|
||||||
|
CONDITION TARGET Qt5::Script
|
||||||
|
DEPENDS Qt5::Script
|
||||||
|
DEFINES WITH_JAVASCRIPTFILTER
|
||||||
|
SOURCES
|
||||||
|
locator/javascriptfilter.cpp locator/javascriptfilter.h
|
||||||
|
)
|
||||||
|
@@ -726,7 +726,7 @@ void SettingsDialog::done(int val)
|
|||||||
QSettings *settings = ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
settings->setValue(QLatin1String(pageKeyC), m_currentPage.toSetting());
|
settings->setValue(QLatin1String(pageKeyC), m_currentPage.toSetting());
|
||||||
|
|
||||||
ICore::saveSettings(); // save all settings
|
ICore::saveSettings(ICore::SettingsDialogDone); // save all settings
|
||||||
|
|
||||||
// exit event loops in reverse order of addition
|
// exit event loops in reverse order of addition
|
||||||
for (QEventLoop *eventLoop : m_eventLoops)
|
for (QEventLoop *eventLoop : m_eventLoops)
|
||||||
|
@@ -330,7 +330,7 @@ ICore::ICore(MainWindow *mainwindow)
|
|||||||
m_mainwindow = mainwindow;
|
m_mainwindow = mainwindow;
|
||||||
// Save settings once after all plugins are initialized:
|
// Save settings once after all plugins are initialized:
|
||||||
connect(PluginManager::instance(), &PluginManager::initializationDone,
|
connect(PluginManager::instance(), &PluginManager::initializationDone,
|
||||||
this, &ICore::saveSettings);
|
this, [] { ICore::saveSettings(ICore::InitializationDone); });
|
||||||
connect(PluginManager::instance(), &PluginManager::testsFinished, [this] (int failedTests) {
|
connect(PluginManager::instance(), &PluginManager::testsFinished, [this] (int failedTests) {
|
||||||
emit coreAboutToClose();
|
emit coreAboutToClose();
|
||||||
if (failedTests != 0)
|
if (failedTests != 0)
|
||||||
@@ -690,9 +690,9 @@ void ICore::setupScreenShooter(const QString &name, QWidget *w, const QRect &rc)
|
|||||||
new ScreenShooter(w, name, rc);
|
new ScreenShooter(w, name, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ICore::saveSettings()
|
void ICore::saveSettings(SaveSettingsReason reason)
|
||||||
{
|
{
|
||||||
emit m_instance->saveSettingsRequested();
|
emit m_instance->saveSettingsRequested(reason);
|
||||||
m_mainwindow->saveSettings();
|
m_mainwindow->saveSettings();
|
||||||
|
|
||||||
ICore::settings(QSettings::SystemScope)->sync();
|
ICore::settings(QSettings::SystemScope)->sync();
|
||||||
|
@@ -141,14 +141,21 @@ public:
|
|||||||
static QString systemInformation();
|
static QString systemInformation();
|
||||||
static void setupScreenShooter(const QString &name, QWidget *w, const QRect &rc = QRect());
|
static void setupScreenShooter(const QString &name, QWidget *w, const QRect &rc = QRect());
|
||||||
|
|
||||||
|
enum SaveSettingsReason {
|
||||||
|
InitializationDone,
|
||||||
|
SettingsDialogDone,
|
||||||
|
ModeChanged,
|
||||||
|
MainWindowClosing,
|
||||||
|
};
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
static void saveSettings();
|
static void saveSettings(SaveSettingsReason reason);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void coreAboutToOpen();
|
void coreAboutToOpen();
|
||||||
void coreOpened();
|
void coreOpened();
|
||||||
void newItemDialogStateChanged();
|
void newItemDialogStateChanged();
|
||||||
void saveSettingsRequested();
|
void saveSettingsRequested(SaveSettingsReason reason);
|
||||||
void coreAboutToClose();
|
void coreAboutToClose();
|
||||||
void contextAboutToChange(const QList<Core::IContext *> &context);
|
void contextAboutToChange(const QList<Core::IContext *> &context);
|
||||||
void contextChanged(const Core::Context &context);
|
void contextChanged(const Core::Context &context);
|
||||||
|
@@ -322,7 +322,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ICore::saveSettings();
|
ICore::saveSettings(ICore::MainWindowClosing);
|
||||||
|
|
||||||
// Save opened files
|
// Save opened files
|
||||||
if (!DocumentManager::saveAllModifiedDocuments()) {
|
if (!DocumentManager::saveAllModifiedDocuments()) {
|
||||||
|
@@ -54,6 +54,14 @@ ProcessParameters::ProcessParameters() :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProcessParameters::setCommandLine(const CommandLine &cmdLine)
|
||||||
|
{
|
||||||
|
m_command = cmdLine.executable();
|
||||||
|
m_arguments = cmdLine.arguments();
|
||||||
|
m_effectiveCommand.clear();
|
||||||
|
m_effectiveArguments.clear();
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the executable to run.
|
Sets the executable to run.
|
||||||
*/
|
*/
|
||||||
|
@@ -30,7 +30,10 @@
|
|||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
namespace Utils { class MacroExpander; }
|
namespace Utils {
|
||||||
|
class CommandLine;
|
||||||
|
class MacroExpander;
|
||||||
|
} // Utils
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
@@ -40,6 +43,8 @@ class PROJECTEXPLORER_EXPORT ProcessParameters
|
|||||||
public:
|
public:
|
||||||
ProcessParameters();
|
ProcessParameters();
|
||||||
|
|
||||||
|
void setCommandLine(const Utils::CommandLine &cmdLine);
|
||||||
|
|
||||||
void setCommand(const Utils::FilePath &cmd);
|
void setCommand(const Utils::FilePath &cmd);
|
||||||
Utils::FilePath command() const { return m_command; }
|
Utils::FilePath command() const { return m_command; }
|
||||||
|
|
||||||
|
@@ -2098,7 +2098,7 @@ void ProjectExplorerPluginPrivate::currentModeChanged(Id mode, Id oldMode)
|
|||||||
// Saving settings directly in a mode change is not a good idea, since the mode change
|
// Saving settings directly in a mode change is not a good idea, since the mode change
|
||||||
// can be part of a bigger change. Save settings after that bigger change had a chance to
|
// can be part of a bigger change. Save settings after that bigger change had a chance to
|
||||||
// complete.
|
// complete.
|
||||||
QTimer::singleShot(0, ICore::instance(), &ICore::saveSettings);
|
QTimer::singleShot(0, ICore::instance(), [] { ICore::saveSettings(ICore::ModeChanged); });
|
||||||
}
|
}
|
||||||
if (mode == Core::Constants::MODE_WELCOME)
|
if (mode == Core::Constants::MODE_WELCOME)
|
||||||
updateWelcomePage();
|
updateWelcomePage();
|
||||||
|
@@ -1554,4 +1554,10 @@ CommandLine Runnable::commandLine() const
|
|||||||
return CommandLine(FilePath::fromString(executable), commandLineArguments);
|
return CommandLine(FilePath::fromString(executable), commandLineArguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Runnable::setCommandLine(const CommandLine &cmdLine)
|
||||||
|
{
|
||||||
|
executable = cmdLine.executable().toString();
|
||||||
|
commandLineArguments = cmdLine.arguments();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
@@ -74,6 +74,7 @@ public:
|
|||||||
Runnable() = default;
|
Runnable() = default;
|
||||||
|
|
||||||
Utils::CommandLine commandLine() const;
|
Utils::CommandLine commandLine() const;
|
||||||
|
void setCommandLine(const Utils::CommandLine &cmdLine);
|
||||||
|
|
||||||
QString executable;
|
QString executable;
|
||||||
QString commandLineArguments;
|
QString commandLineArguments;
|
||||||
|
@@ -85,6 +85,7 @@ public:
|
|||||||
bool defaultPropertyIsComponent() const;
|
bool defaultPropertyIsComponent() const;
|
||||||
|
|
||||||
TypeName typeName() const;
|
TypeName typeName() const;
|
||||||
|
TypeName simplifiedTypeName() const;
|
||||||
int majorVersion() const;
|
int majorVersion() const;
|
||||||
int minorVersion() const;
|
int minorVersion() const;
|
||||||
|
|
||||||
|
@@ -1483,6 +1483,11 @@ TypeName NodeMetaInfo::typeName() const
|
|||||||
return m_privateData->qualfiedTypeName();
|
return m_privateData->qualfiedTypeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TypeName NodeMetaInfo::simplifiedTypeName() const
|
||||||
|
{
|
||||||
|
return typeName().split('.').constLast();
|
||||||
|
}
|
||||||
|
|
||||||
int NodeMetaInfo::majorVersion() const
|
int NodeMetaInfo::majorVersion() const
|
||||||
{
|
{
|
||||||
return m_privateData->majorVersion();
|
return m_privateData->majorVersion();
|
||||||
|
@@ -2,8 +2,7 @@ add_subdirectory(source)
|
|||||||
|
|
||||||
add_qtc_executable(clangrefactoringbackend
|
add_qtc_executable(clangrefactoringbackend
|
||||||
DEPENDS
|
DEPENDS
|
||||||
clangrefactoringbackend_lib Sqlite ClangSupport
|
clangrefactoringbackend_lib Sqlite
|
||||||
libclang clangTooling clangIndex clangQuery clangToolingRefactor
|
|
||||||
SOURCES
|
SOURCES
|
||||||
clangrefactoringbackendmain.cpp
|
clangrefactoringbackendmain.cpp
|
||||||
)
|
)
|
||||||
|
@@ -1,5 +1,11 @@
|
|||||||
add_qtc_library(clangrefactoringbackend_lib STATIC
|
add_qtc_library(clangrefactoringbackend_lib STATIC
|
||||||
DEPENDS libclang clangTooling clangIndex clangQuery ClangSupport
|
PUBLIC_DEPENDS
|
||||||
|
Threads::Threads
|
||||||
|
LLVMCore libclang
|
||||||
|
clangAST clangASTMatchers clangBasic clangDynamicASTMatchers clangFrontend
|
||||||
|
clangHandleCXX clangIndex clangLex
|
||||||
|
clangSerialization clangTooling clangQuery
|
||||||
|
ClangSupport
|
||||||
DEFINES CLANGSUPPORT_BUILD_LIB
|
DEFINES CLANGSUPPORT_BUILD_LIB
|
||||||
PUBLIC_INCLUDES
|
PUBLIC_INCLUDES
|
||||||
${CLANG_INCLUDE_DIRS}
|
${CLANG_INCLUDE_DIRS}
|
||||||
|
@@ -30,10 +30,12 @@ SOURCES += \
|
|||||||
rmqtoperation.cpp \
|
rmqtoperation.cpp \
|
||||||
rmtoolchainoperation.cpp \
|
rmtoolchainoperation.cpp \
|
||||||
settings.cpp \
|
settings.cpp \
|
||||||
|
$$UTILS/environment.cpp \
|
||||||
$$UTILS/fileutils.cpp \
|
$$UTILS/fileutils.cpp \
|
||||||
$$UTILS/hostosinfo.cpp \
|
$$UTILS/hostosinfo.cpp \
|
||||||
$$UTILS/persistentsettings.cpp \
|
$$UTILS/persistentsettings.cpp \
|
||||||
$$UTILS/qtcassert.cpp \
|
$$UTILS/qtcassert.cpp \
|
||||||
|
$$UTILS/qtcprocess.cpp \
|
||||||
$$UTILS/savefile.cpp \
|
$$UTILS/savefile.cpp \
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
@@ -57,10 +59,12 @@ HEADERS += \
|
|||||||
rmqtoperation.h \
|
rmqtoperation.h \
|
||||||
rmtoolchainoperation.h \
|
rmtoolchainoperation.h \
|
||||||
settings.h \
|
settings.h \
|
||||||
|
$$UTILS/environment.h \
|
||||||
$$UTILS/fileutils.h \
|
$$UTILS/fileutils.h \
|
||||||
$$UTILS/hostosinfo.h \
|
$$UTILS/hostosinfo.h \
|
||||||
$$UTILS/persistentsettings.h \
|
$$UTILS/persistentsettings.h \
|
||||||
$$UTILS/qtcassert.h \
|
$$UTILS/qtcassert.h \
|
||||||
|
$$UTILS/qtcprocess.h \
|
||||||
$$UTILS/savefile.h \
|
$$UTILS/savefile.h \
|
||||||
|
|
||||||
macos {
|
macos {
|
||||||
|
@@ -66,10 +66,12 @@ QtcTool {
|
|||||||
name: "Utils"
|
name: "Utils"
|
||||||
prefix: libsDir + "/utils/"
|
prefix: libsDir + "/utils/"
|
||||||
files: [
|
files: [
|
||||||
|
"environment.cpp", "environment.h",
|
||||||
"fileutils.cpp", "fileutils.h",
|
"fileutils.cpp", "fileutils.h",
|
||||||
"hostosinfo.cpp", "hostosinfo.h",
|
"hostosinfo.cpp", "hostosinfo.h",
|
||||||
"persistentsettings.cpp", "persistentsettings.h",
|
"persistentsettings.cpp", "persistentsettings.h",
|
||||||
"qtcassert.cpp", "qtcassert.h",
|
"qtcassert.cpp", "qtcassert.h",
|
||||||
|
"qtcprocess.cpp", "qtcprocess.h",
|
||||||
"savefile.cpp", "savefile.h"
|
"savefile.cpp", "savefile.h"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -93,7 +93,7 @@ static bool generateEnvironmentSettings(Utils::Environment &env,
|
|||||||
const QString cmdPath = QString::fromLocal8Bit(qgetenv("COMSPEC"));
|
const QString cmdPath = QString::fromLocal8Bit(qgetenv("COMSPEC"));
|
||||||
// Windows SDK setup scripts require command line switches for environment expansion.
|
// Windows SDK setup scripts require command line switches for environment expansion.
|
||||||
QString cmdArguments = " /E:ON /V:ON /c \"" + QDir::toNativeSeparators(saver.fileName()) + '"';
|
QString cmdArguments = " /E:ON /V:ON /c \"" + QDir::toNativeSeparators(saver.fileName()) + '"';
|
||||||
run.setCommand(cmdPath, cmdArguments);
|
run.setCommand(Utils::CommandLine(cmdPath, cmdArguments));
|
||||||
run.start();
|
run.start();
|
||||||
|
|
||||||
if (!run.waitForStarted()) {
|
if (!run.waitForStarted()) {
|
||||||
|
Reference in New Issue
Block a user