Skip to content

Commit a41d4d9

Browse files
authored
Merge pull request probonopd#291 from hkollmann/find_qmake_in_exepath
Find qmake in exepath
2 parents bba42c7 + c018349 commit a41d4d9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/linuxdeployqt/shared.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,11 @@ DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &a
10701070
// Use the qmake executable passed in by the user:
10711071
QString qmakePath = qmake;
10721072

1073+
if (qmakePath.isEmpty()) {
1074+
// Try to find qmake in the same path as the executable
1075+
QString path = QCoreApplication::applicationDirPath();
1076+
qmakePath = QStandardPaths::findExecutable("qmake", QStringList(path));
1077+
}
10731078
if (qmakePath.isEmpty()) {
10741079
// Try to find a version specific qmake first
10751080
// openSUSE has qmake for Qt 4 and qmake-qt5 for Qt 5
@@ -1083,13 +1088,13 @@ DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &a
10831088
LogDebug() << "qmake 4";
10841089
}
10851090

1086-
if(qmakePath == ""){
1091+
if(qmakePath.isEmpty()){
10871092
// The upstream name of the binary is "qmake", for Qt 4 and Qt 5
10881093
qmakePath = QStandardPaths::findExecutable("qmake");
10891094
}
10901095
}
10911096

1092-
if(qmakePath == ""){
1097+
if(qmakePath.isEmpty()){
10931098
LogError() << "qmake not found on the $PATH";
10941099
exit(1);
10951100
}

0 commit comments

Comments
 (0)