mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-13 18:09:34 +00:00
ref #422 fixed init qmake
This commit is contained in:
parent
30a940d966
commit
1e99587e5f
@ -897,6 +897,13 @@ bool ConfigParser::initQmakePrivate(const QString &qmake) {
|
|||||||
|
|
||||||
bool ConfigParser::initQmake() {
|
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");
|
auto qmake = QuasarAppUtils::Params::getStrArg("qmake");
|
||||||
|
|
||||||
QFileInfo info(qmake);
|
QFileInfo info(qmake);
|
||||||
@ -907,27 +914,31 @@ bool ConfigParser::initQmake() {
|
|||||||
|
|
||||||
if (qtList.isEmpty()) {
|
if (qtList.isEmpty()) {
|
||||||
|
|
||||||
if (!QuasarAppUtils::Params::isEndable("noCheckPATH") && isNeededQt()) {
|
if (!QuasarAppUtils::Params::isEndable("noCheckPATH")) {
|
||||||
auto env = QProcessEnvironment::systemEnvironment();
|
auto env = QProcessEnvironment::systemEnvironment();
|
||||||
auto proc = DeployCore::findProcess(env.value("PATH"), "qmake");
|
auto proc = DeployCore::findProcess(env.value("PATH"), "qmake");
|
||||||
if (proc.isEmpty()) {
|
if (proc.isEmpty()) {
|
||||||
QuasarAppUtils::Params::log("The deployment target requir Qt libs, but init qmake is failed.",
|
QuasarAppUtils::Params::log("The deployment target requir Qt libs, but init qmake is failed."
|
||||||
QuasarAppUtils::Error);
|
"Use the qmake option for set a path to qmake.",
|
||||||
|
QuasarAppUtils::Error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return initQmakePrivate(proc);
|
return initQmakePrivate(proc);
|
||||||
}
|
}
|
||||||
QuasarAppUtils::Params::log("deploy only C libs because qmake is not found",
|
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Params::log("You Application requeriment Qt libs but the qmake not findet by option 'qmake' and RPATH."
|
||||||
return true;
|
"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) {
|
if (qtList.size() > 1) {
|
||||||
QuasarAppUtils::Params::log("Your deployment targets were compiled by different qmake,"
|
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.",
|
"qt auto-capture is not possible. Use the -qmake flag to solve this problem.",
|
||||||
QuasarAppUtils::Error);
|
QuasarAppUtils::Error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -939,6 +950,7 @@ bool ConfigParser::initQmake() {
|
|||||||
|
|
||||||
return initQmakePrivate(QFileInfo(qt + "/qmake").absoluteFilePath());
|
return initQmakePrivate(QFileInfo(qt + "/qmake").absoluteFilePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
return initQmakePrivate(qmake);
|
return initQmakePrivate(qmake);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ bool ELF::getLibInfo(const QString &lib, LibInfo &info) const {
|
|||||||
|
|
||||||
auto dep = reader.dependencies();
|
auto dep = reader.dependencies();
|
||||||
for (const auto &i : dep) {
|
for (const auto &i : dep) {
|
||||||
info.addDependncies(i.toUpper());
|
info.addDependncies(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -56,9 +56,8 @@ bool Extracter::extractWebEngine() {
|
|||||||
|
|
||||||
if (cnf->qtDir.getQtPlatform() & Platform::Unix) {
|
if (cnf->qtDir.getQtPlatform() & Platform::Unix) {
|
||||||
webEngeneBin += "/QtWebEngineProcess";
|
webEngeneBin += "/QtWebEngineProcess";
|
||||||
} else {
|
} else if (cnf->qtDir.getQtPlatform() & Platform::Win) {
|
||||||
webEngeneBin += "/QtWebEngineProcess.exe";
|
webEngeneBin += "/QtWebEngineProcess.exe";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destWebEngine = cnf->getTargetDir() + "/" + package + cnf->packages()[package].getBinOutDir();
|
auto destWebEngine = cnf->getTargetDir() + "/" + package + cnf->packages()[package].getBinOutDir();
|
||||||
|
@ -14,7 +14,7 @@ class DEPLOYSHARED_EXPORT QtDir {
|
|||||||
QString translations;
|
QString translations;
|
||||||
QString resources;
|
QString resources;
|
||||||
|
|
||||||
Platform qtPlatform;
|
Platform qtPlatform = UnknownPlatform;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -80,7 +80,6 @@ private slots:
|
|||||||
void testStrip();
|
void testStrip();
|
||||||
void testExtractLib();
|
void testExtractLib();
|
||||||
void testRelativeLink();
|
void testRelativeLink();
|
||||||
void testCheckQt();
|
|
||||||
|
|
||||||
void testQmlExtrct();
|
void testQmlExtrct();
|
||||||
void testSetTargetDir();
|
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() {
|
void deploytest::testSetTargetDir() {
|
||||||
|
|
||||||
FileManager file;
|
FileManager file;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user