mirror of
https://github.com/QuasarApp/QtDeployer.git
synced 2025-04-26 13:34:32 +00:00
fix build from pro file
This commit is contained in:
parent
51a1a4c2c3
commit
a2a14db86d
@ -1,5 +1,5 @@
|
|||||||
name: qt-deployer
|
name: qt-deployer
|
||||||
version: '1.1.0'
|
version: '1.1.1'
|
||||||
summary: Deploy Qt Project
|
summary: Deploy Qt Project
|
||||||
description: |
|
description: |
|
||||||
Deploy Qt Projects. this application extract all depends library of executable and create launch script for your application. |
|
Deploy Qt Projects. this application extract all depends library of executable and create launch script for your application. |
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
QString BaseClass::m_qtdir = QString();
|
QString BaseClass::m_qtdir = QString();
|
||||||
QString BaseClass::m_outputdir = QString();
|
QString BaseClass::m_outputdir = QString();
|
||||||
QString BaseClass::m_projectdir = QString();
|
QString BaseClass::m_projectfile = QString();
|
||||||
QString BaseClass::m_executablepath = QString();
|
QString BaseClass::m_executablepath = QString();
|
||||||
QString BaseClass::m_binarycreator = QString();
|
QString BaseClass::m_binarycreator = QString();
|
||||||
QString BaseClass::projectName = QString();
|
QString BaseClass::projectName = QString();
|
||||||
|
@ -18,7 +18,7 @@ protected:
|
|||||||
static QString m_qtdir;
|
static QString m_qtdir;
|
||||||
static QString m_outputdir;
|
static QString m_outputdir;
|
||||||
static QString m_binarycreator;
|
static QString m_binarycreator;
|
||||||
static QString m_projectdir;
|
static QString m_projectfile;
|
||||||
static QString m_executablepath;
|
static QString m_executablepath;
|
||||||
static QString projectName;
|
static QString projectName;
|
||||||
static QString appIcon;
|
static QString appIcon;
|
||||||
|
@ -56,17 +56,14 @@ bool BuildManager::createFulder(QDir& dir, QString &path, const QString &name) c
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool BuildManager::initFolders() {
|
bool BuildManager::initFolders() {
|
||||||
QDir dir(m_projectdir);
|
|
||||||
|
QFileInfo pro(m_projectfile);
|
||||||
|
QDir dir = pro.absoluteDir();
|
||||||
if(!dir.cd("..")) {
|
if(!dir.cd("..")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
QStringList filesList = findFilesInsideDir("*.pro", m_projectdir);
|
|
||||||
|
|
||||||
if(filesList.size() < 1){
|
QFile f(m_projectfile);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
QFile f(filesList.first());
|
|
||||||
if(!f.open(QIODevice::ReadOnly | QIODevice::Text)){
|
if(!f.open(QIODevice::ReadOnly | QIODevice::Text)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -77,8 +74,9 @@ bool BuildManager::initFolders() {
|
|||||||
proFile.replace(" ", "");
|
proFile.replace(" ", "");
|
||||||
int tempIndex = proFile.indexOf(QRegExp("TARGET=") );
|
int tempIndex = proFile.indexOf(QRegExp("TARGET=") );
|
||||||
if(tempIndex < 0) {
|
if(tempIndex < 0) {
|
||||||
return false;
|
|
||||||
}
|
projectName = pro.baseName();
|
||||||
|
} else {
|
||||||
int beginTarget = tempIndex + 7;
|
int beginTarget = tempIndex + 7;
|
||||||
|
|
||||||
tempIndex = proFile.indexOf("\n", beginTarget);
|
tempIndex = proFile.indexOf("\n", beginTarget);
|
||||||
@ -88,6 +86,8 @@ bool BuildManager::initFolders() {
|
|||||||
longTraget = tempIndex - beginTarget;
|
longTraget = tempIndex - beginTarget;
|
||||||
}
|
}
|
||||||
projectName = proFile.mid(beginTarget, longTraget);
|
projectName = proFile.mid(beginTarget, longTraget);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!createFulder(dir, tempBuildFolder, "Build-" + projectName)){
|
if(!createFulder(dir, tempBuildFolder, "Build-" + projectName)){
|
||||||
return false;
|
return false;
|
||||||
@ -113,7 +113,7 @@ bool BuildManager::build(){
|
|||||||
|
|
||||||
pQMake.setProgram(qmake);
|
pQMake.setProgram(qmake);
|
||||||
pQMake.setWorkingDirectory(tempBuildFolder);
|
pQMake.setWorkingDirectory(tempBuildFolder);
|
||||||
pQMake.setArguments(QStringList() << m_projectdir);
|
pQMake.setArguments(QStringList() << m_projectfile);
|
||||||
|
|
||||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||||
env.insert("LD_LIBRARY_PATH", m_qtdir + "/lib");
|
env.insert("LD_LIBRARY_PATH", m_qtdir + "/lib");
|
||||||
|
@ -52,7 +52,7 @@ void MainManager::prepare(const QString &qtdir, const QString &projectdir, const
|
|||||||
if (S[S.count() - 1] == '/') S.remove(S.count() - 1, 1);
|
if (S[S.count() - 1] == '/') S.remove(S.count() - 1, 1);
|
||||||
|
|
||||||
m_qtdir = list[0];
|
m_qtdir = list[0];
|
||||||
m_projectdir = list[1];
|
m_projectfile = list[1];
|
||||||
|
|
||||||
if(QFileInfo(icon).exists()){
|
if(QFileInfo(icon).exists()){
|
||||||
appIcon = icon;
|
appIcon = icon;
|
||||||
|
@ -15,8 +15,6 @@ class MainManager : public BaseClass
|
|||||||
|
|
||||||
Q_PROPERTY(int state READ state WRITE setState NOTIFY stateChanged)
|
Q_PROPERTY(int state READ state WRITE setState NOTIFY stateChanged)
|
||||||
Q_PROPERTY(QString outDir READ outDir NOTIFY outDirChanged)
|
Q_PROPERTY(QString outDir READ outDir NOTIFY outDirChanged)
|
||||||
Q_PROPERTY(QString appVer READ appVer)
|
|
||||||
|
|
||||||
|
|
||||||
CppManager *m_cpp;
|
CppManager *m_cpp;
|
||||||
QmlManager *m_qml;
|
QmlManager *m_qml;
|
||||||
|
@ -62,8 +62,10 @@ QStringList PluginManager::findPluginsFromModules()
|
|||||||
|
|
||||||
QStringList PluginManager::extractModules()
|
QStringList PluginManager::extractModules()
|
||||||
{
|
{
|
||||||
QStringList proandprifiles = findFilesInsideDir("*.pro", m_projectdir);
|
QStringList proandprifiles =
|
||||||
proandprifiles << findFilesInsideDir("*.pri", m_projectdir);
|
findFilesInsideDir("*.pro", QFileInfo(m_projectfile).absoluteDir().path());
|
||||||
|
proandprifiles << findFilesInsideDir("*.pri",
|
||||||
|
QFileInfo(m_projectfile).absoluteDir().path());
|
||||||
|
|
||||||
QStringList modules;
|
QStringList modules;
|
||||||
for (const QString &file : proandprifiles)
|
for (const QString &file : proandprifiles)
|
||||||
|
@ -119,7 +119,7 @@ void QmlManager::start()
|
|||||||
m_foundImports.clear();
|
m_foundImports.clear();
|
||||||
m_notFoundImports.clear();
|
m_notFoundImports.clear();
|
||||||
|
|
||||||
extractImportsFromDir(m_projectdir);
|
extractImportsFromDir(QFileInfo(m_projectfile).absoluteDir().path());
|
||||||
removeInnerImports();
|
removeInnerImports();
|
||||||
divideFoundAndNotFound();
|
divideFoundAndNotFound();
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ Item {
|
|||||||
text: qsTr("This application forked by ShahriarSS
|
text: qsTr("This application forked by ShahriarSS
|
||||||
Page of original soft: https://github.com/ShahriarSS/QtLinuxDeployer
|
Page of original soft: https://github.com/ShahriarSS/QtLinuxDeployer
|
||||||
|
|
||||||
version: "+MainManager.appVer+"
|
version: "+MainManager.appVer()+"
|
||||||
|
|
||||||
Developers of fork:
|
Developers of fork:
|
||||||
* Programmer: Yankovich Andrei.
|
* Programmer: Yankovich Andrei.
|
||||||
|
@ -48,7 +48,7 @@ ColumnLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
text: "Browse"
|
text: qsTr("Browse")
|
||||||
onClicked: fd.open()
|
onClicked: fd.open()
|
||||||
Material.background: buttonColor
|
Material.background: buttonColor
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,10 @@ Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PathChooser {
|
PathChooser {
|
||||||
id: projectdir
|
id: projectfile
|
||||||
title: qsTr("Project Directory")
|
title: qsTr("Project File")
|
||||||
|
isdir: false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PathChooser {
|
PathChooser {
|
||||||
@ -44,10 +46,10 @@ Page {
|
|||||||
text: qsTr("Next")
|
text: qsTr("Next")
|
||||||
Material.background: buttonColor
|
Material.background: buttonColor
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
enabled: qtdir.confirmed && projectdir.confirmed
|
enabled: qtdir.confirmed && projectfile.confirmed
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
MainManager.prepare(qtdir.content, projectdir.content, icon.content)
|
MainManager.prepare(qtdir.content, projectfile.content, icon.content)
|
||||||
|
|
||||||
prp.outdir = MainManager.outDir
|
prp.outdir = MainManager.outDir
|
||||||
swipeview.currentIndex = 1
|
swipeview.currentIndex = 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user