4
1
mirror of https://github.com/QuasarApp/CQtDeployer.git synced 2025-05-09 16:09:37 +00:00

ref fixed init qmake

This commit is contained in:
Andrei Yankovich 2020-10-13 14:07:51 +03:00
parent 30a940d966
commit 1e99587e5f
5 changed files with 23 additions and 99 deletions

@ -897,6 +897,13 @@ bool ConfigParser::initQmakePrivate(const QString &qmake) {
bool ConfigParser::initQmake() {
if (!isNeededQt()) {
QuasarAppUtils::Params::log("deploy only C/C++ libraryes because a qmake is not needed"
" for the distribution",
QuasarAppUtils::Info);
return true;
}
auto qmake = QuasarAppUtils::Params::getStrArg("qmake");
QFileInfo info(qmake);
@ -907,27 +914,31 @@ bool ConfigParser::initQmake() {
if (qtList.isEmpty()) {
if (!QuasarAppUtils::Params::isEndable("noCheckPATH") && isNeededQt()) {
if (!QuasarAppUtils::Params::isEndable("noCheckPATH")) {
auto env = QProcessEnvironment::systemEnvironment();
auto proc = DeployCore::findProcess(env.value("PATH"), "qmake");
if (proc.isEmpty()) {
QuasarAppUtils::Params::log("The deployment target requir Qt libs, but init qmake is failed.",
QuasarAppUtils::Error);
QuasarAppUtils::Params::log("The deployment target requir Qt libs, but init qmake is failed."
"Use the qmake option for set a path to qmake.",
QuasarAppUtils::Error);
return false;
}
return initQmakePrivate(proc);
}
QuasarAppUtils::Params::log("deploy only C libs because qmake is not found",
QuasarAppUtils::Info);
return true;
QuasarAppUtils::Params::log("You Application requeriment Qt libs but the qmake not findet by option 'qmake' and RPATH."
"You use option noCheckPATH. Disable the option noCheckPATH from your deploy command for search qmake from PATH",
QuasarAppUtils::Error);
return false;
}
if (qtList.size() > 1) {
QuasarAppUtils::Params::log("Your deployment targets were compiled by different qmake,"
"qt auto-capture is not possible. Use the -qmake flag to solve this problem.",
QuasarAppUtils::Error);
"qt auto-capture is not possible. Use the -qmake flag to solve this problem.",
QuasarAppUtils::Error);
return false;
}
@ -939,6 +950,7 @@ bool ConfigParser::initQmake() {
return initQmakePrivate(QFileInfo(qt + "/qmake").absoluteFilePath());
}
return initQmakePrivate(qmake);
}

@ -87,7 +87,7 @@ bool ELF::getLibInfo(const QString &lib, LibInfo &info) const {
auto dep = reader.dependencies();
for (const auto &i : dep) {
info.addDependncies(i.toUpper());
info.addDependncies(i);
}
return true;

@ -56,9 +56,8 @@ bool Extracter::extractWebEngine() {
if (cnf->qtDir.getQtPlatform() & Platform::Unix) {
webEngeneBin += "/QtWebEngineProcess";
} else {
} else if (cnf->qtDir.getQtPlatform() & Platform::Win) {
webEngeneBin += "/QtWebEngineProcess.exe";
}
auto destWebEngine = cnf->getTargetDir() + "/" + package + cnf->packages()[package].getBinOutDir();

@ -14,7 +14,7 @@ class DEPLOYSHARED_EXPORT QtDir {
QString translations;
QString resources;
Platform qtPlatform;
Platform qtPlatform = UnknownPlatform;
public:

@ -80,7 +80,6 @@ private slots:
void testStrip();
void testExtractLib();
void testRelativeLink();
void testCheckQt();
void testQmlExtrct();
void testSetTargetDir();
@ -830,92 +829,6 @@ void deploytest::testRelativeLink() {
}
}
void deploytest::testCheckQt() {
Deploy *deployer = new Deploy();
QuasarAppUtils::Params::parseParams({"-binDir", TestBinDir, "clear",
"noCheckRPATH", "noCheckPATH"});
QVERIFY(deployer->prepare());
auto cases = QList<QPair<QString, bool>>{
{TestQtDir + "/", false},
{TestQtDir + "", false},
{TestQtDir + "/bin/file1", false},
{TestQtDir + "/lib/file12", false},
{TestQtDir + "/resurces/file13", false},
{TestQtDir + "/libexec/f", false},
{TestQtDir + "/mkspecs", false},
{TestQtDir + "/qml", false},
{TestQtDir + "/plugins", false},
{TestQtDir + "/file", false},
{TestQtDir + "\\", false},
{TestQtDir + "", false},
{TestQtDir + "\\bin\\file1", false},
{TestQtDir + "\\lib\\file12", false},
{TestQtDir + "\\resurces\\file13", false},
{TestQtDir + "\\libexec\\f", false},
{TestQtDir + "\\mkspecs", false},
{TestQtDir + "\\qml", false},
{TestQtDir + "\\plugins", false},
{TestQtDir + "\\file", false},
};
for (const auto &i: cases) {
QVERIFY(DeployCore::isQtLib(i.first) == i.second);
}
delete deployer;
#ifdef Q_OS_UNIX
QString bin = TestBinDir + "TestQMLWidgets";
QString qmake = TestQtDir + "bin/qmake";
#else
QString bin = TestBinDir + "TestQMLWidgets.exe";
QString qmake = TestQtDir + "bin/qmake.exe";
#endif
deployer = new Deploy();
QuasarAppUtils::Params::parseParams({"-bin", bin, "clear" ,
"-qmake", qmake,
"-qmlDir", TestBinDir + "/../TestQMLWidgets"});
QVERIFY(deployer->prepare());
cases = QList<QPair<QString, bool>>{
{TestQtDir + "/", false},
{TestQtDir + "", false},
{TestQtDir + "/bin/file1", true},
{TestQtDir + "/lib/file12", true},
{TestQtDir + "/resources/file13", true},
{TestQtDir + "/libexec/f", true},
{TestQtDir + "/mkspecs", false},
{TestQtDir + "/qml", true},
{TestQtDir + "/plugins", true},
{TestQtDir + "/file", false},
{TestQtDir + "\\", false},
{TestQtDir + "", false},
{TestQtDir + "\\bin\\file1", true},
{TestQtDir + "\\lib\\file12", true},
{TestQtDir + "\\resources\\file13", true},
{TestQtDir + "\\libexec\\f", true},
{TestQtDir + "\\mkspecs", false},
{TestQtDir + "\\qml", true},
{TestQtDir + "\\plugins", true},
{TestQtDir + "\\file", false},
};
for (const auto &i: cases) {
QVERIFY(DeployCore::isQtLib(i.first) == i.second);
}
delete deployer;
}
void deploytest::testSetTargetDir() {
FileManager file;