forked from qt-creator/qt-creator
QtSupport: Move qtSoPaths from Android
Also add QT_INSTALL_IMPORTS, which is used in a so-called "copy" of the code in the QtApplicationManager plugin. More is better in this case. Change-Id: Ie705d95a24664d3627875ee0463e83a13b830260 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -60,31 +60,6 @@ using namespace ProjectExplorer;
|
|||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
static const char * const qMakeVariables[] = {
|
|
||||||
"QT_INSTALL_LIBS",
|
|
||||||
"QT_INSTALL_PLUGINS",
|
|
||||||
"QT_INSTALL_QML"
|
|
||||||
};
|
|
||||||
|
|
||||||
static QStringList qtSoPaths(QtSupport::BaseQtVersion *qtVersion)
|
|
||||||
{
|
|
||||||
if (!qtVersion)
|
|
||||||
return QStringList();
|
|
||||||
|
|
||||||
QSet<QString> paths;
|
|
||||||
for (uint i = 0; i < sizeof qMakeVariables / sizeof qMakeVariables[0]; ++i) {
|
|
||||||
QString path = qtVersion->qmakeProperty(qMakeVariables[i]);
|
|
||||||
if (path.isNull())
|
|
||||||
continue;
|
|
||||||
QDirIterator it(path, QStringList("*.so"), QDir::Files, QDirIterator::Subdirectories);
|
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
paths.insert(it.fileInfo().absolutePath());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Utils::toList(paths);
|
|
||||||
}
|
|
||||||
|
|
||||||
static QStringList uniquePaths(const QStringList &files)
|
static QStringList uniquePaths(const QStringList &files)
|
||||||
{
|
{
|
||||||
QSet<QString> paths;
|
QSet<QString> paths;
|
||||||
@@ -170,7 +145,8 @@ void AndroidDebugSupport::start()
|
|||||||
const ProjectNode *node = target->project()->findNodeForBuildKey(runControl()->buildKey());
|
const ProjectNode *node = target->project()->findNodeForBuildKey(runControl()->buildKey());
|
||||||
QStringList solibSearchPath = getSoLibSearchPath(node);
|
QStringList solibSearchPath = getSoLibSearchPath(node);
|
||||||
QStringList extraLibs = getExtraLibs(node);
|
QStringList extraLibs = getExtraLibs(node);
|
||||||
solibSearchPath.append(qtSoPaths(qtVersion));
|
if (qtVersion)
|
||||||
|
solibSearchPath.append(qtVersion->qtSoPaths());
|
||||||
solibSearchPath.append(uniquePaths(extraLibs));
|
solibSearchPath.append(uniquePaths(extraLibs));
|
||||||
solibSearchPath.append(target->activeBuildConfiguration()->buildDirectory().toString());
|
solibSearchPath.append(target->activeBuildConfiguration()->buildDirectory().toString());
|
||||||
solibSearchPath.removeDuplicates();
|
solibSearchPath.removeDuplicates();
|
||||||
|
|||||||
@@ -1280,6 +1280,29 @@ QString BaseQtVersion::examplesPath() const
|
|||||||
return QFileInfo(qmakeProperty("QT_INSTALL_EXAMPLES")).canonicalFilePath();
|
return QFileInfo(qmakeProperty("QT_INSTALL_EXAMPLES")).canonicalFilePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList BaseQtVersion::qtSoPaths() const
|
||||||
|
{
|
||||||
|
static const char * const qMakeVariables[] = {
|
||||||
|
"QT_INSTALL_LIBS",
|
||||||
|
"QT_INSTALL_PLUGINS",
|
||||||
|
"QT_INSTALL_QML",
|
||||||
|
"QT_INSTALL_IMPORTS"
|
||||||
|
};
|
||||||
|
|
||||||
|
QSet<QString> paths;
|
||||||
|
for (uint i = 0; i < sizeof qMakeVariables / sizeof qMakeVariables[0]; ++i) {
|
||||||
|
QString path = qmakeProperty(qMakeVariables[i]);
|
||||||
|
if (path.isNull())
|
||||||
|
continue;
|
||||||
|
QDirIterator it(path, QStringList("*.so"), QDir::Files, QDirIterator::Subdirectories);
|
||||||
|
while (it.hasNext()) {
|
||||||
|
it.next();
|
||||||
|
paths.insert(it.fileInfo().absolutePath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Utils::toList(paths);
|
||||||
|
}
|
||||||
|
|
||||||
QStringList BaseQtVersion::configValues() const
|
QStringList BaseQtVersion::configValues() const
|
||||||
{
|
{
|
||||||
ensureMkSpecParsed();
|
ensureMkSpecParsed();
|
||||||
|
|||||||
@@ -146,6 +146,8 @@ public:
|
|||||||
bool hasExamples() const;
|
bool hasExamples() const;
|
||||||
QString examplesPath() const;
|
QString examplesPath() const;
|
||||||
|
|
||||||
|
QStringList qtSoPaths() const;
|
||||||
|
|
||||||
bool hasDocumentation() const;
|
bool hasDocumentation() const;
|
||||||
QString documentationPath() const;
|
QString documentationPath() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user