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