Skip to content

Commit 93ba2f1

Browse files
Skycoder42probonopd
authored andcommitted
Qt module project structure (probonopd#124)
Refactor the project structure to make it build as a "Qt module". It's a first step to get this tool closer to Qt. The main advantage here is: Simply running: ``` qmake make make install ``` will compile and install the tool into your Qt installation, and make it a part of your Qt just like any other tool (qmake, etc.)
1 parent d6b9ee7 commit 93ba2f1

13 files changed

+56
-10
lines changed

Diff for: .qmake.conf

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load(qt_build_config)
2+
3+
CONFIG += warning_clean exceptions
4+
5+
MODULE_VERSION = 0.5.0

Diff for: BUILDING.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ git clone https://github.com/probonopd/linuxdeployqt.git
1212
# Then build in Qt Creator, or use
1313
export PATH=$(readlink -f /tmp/.mount_QtCreator-*-x86_64/*/gcc_64/bin/):$PATH
1414
cd linuxdeployqt
15-
qmake linuxdeployqt.pro
15+
qmake
1616
make
1717
```
1818

19+
* Optional if you want to install `linuxdeployqt` into your Qt installation, and make it a part of your Qt just like any other tool (qmake, etc.)
20+
21+
```
22+
sudo make install
23+
```
24+
1925
* Build and install [patchelf](https://nixos.org/patchelf.html) (a small utility to modify the dynamic linker and RPATH of ELF executables; similar to `install_name_tool` on macOS). To learn more about this, see http://blog.qt.io/blog/2011/10/28/rpath-and-runpath/
2026

2127
```

Diff for: linuxdeployqt.pro

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
TEMPLATE = subdirs
2-
SUBDIRS = linuxdeployqt
1+
load(qt_parts)

Diff for: linuxdeployqt/linuxdeployqt.pro

-2
This file was deleted.

Diff for: src/src.pro

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TEMPLATE = aux

Diff for: sync.profile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%modules = (
2+
);
3+
4+
%moduleheaders = (
5+
);

Diff for: tests/tests-ci.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ mkdir -p linuxdeployqt.AppDir/usr/bin/
1010
cp /usr/bin/patchelf /usr/local/bin/{appimagetool,mksquashfs,zsyncmake} linuxdeployqt.AppDir/usr/bin/
1111
find linuxdeployqt.AppDir/
1212
export VERSION=continuous
13-
cp ./linuxdeployqt/linuxdeployqt linuxdeployqt.AppDir/usr/bin/
14-
./linuxdeployqt/linuxdeployqt linuxdeployqt.AppDir/linuxdeployqt.desktop -verbose=3 -appimage
13+
cp ./bin/linuxdeployqt linuxdeployqt.AppDir/usr/bin/
14+
./bin/linuxdeployqt linuxdeployqt.AppDir/linuxdeployqt.desktop -verbose=3 -appimage
1515
ls -lh
1616
find *.AppDir
1717
xpra start :99

Diff for: tests/tests.pro

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
TEMPLATE = subdirs
2+
3+
SUBDIRS += \
4+
QtQuickControls2Application \
5+
QtWebEngineApplication \
6+
QtWidgetsApplication
7+
8+
DISTFILES += \
9+
tests-ci.sh \
10+
tests-environment.sh \
11+
tests.sh

Diff for: tools/linuxdeployqt/linuxdeployqt.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
option(host_build)
2+
3+
QT = core
4+
CONFIG += console
5+
6+
TARGET = linuxdeployqt
7+
VERSION = $$MODULE_VERSION
8+
9+
DEFINES += BUILD_LINUXDEPLOYQT
10+
11+
load(qt_tool)
12+
13+
HEADERS += shared.h
14+
SOURCES += main.cpp \
15+
shared.cpp
16+
17+
DEFINES -= QT_USE_QSTRINGBUILDER #leads to compile errors if not disabled

Diff for: linuxdeployqt/main.cpp renamed to tools/linuxdeployqt/main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <QCoreApplication>
2929
#include <QDir>
3030
#include <QProcessEnvironment>
31-
#include "../shared/shared.h"
31+
#include "shared.h"
3232
#include <QRegularExpression>
3333
#include <stdlib.h>
3434
#include <QSettings>
@@ -146,7 +146,7 @@ int main(int argc, char **argv)
146146
// Allow binaries next to linuxdeployqt to be found; this is useful for bundling
147147
// this application itself together with helper binaries such as patchelf
148148
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
149-
QString oldPath = env.value("PATH");
149+
QString oldPath = env.value("PATH");
150150
QString newPath = QCoreApplication::applicationDirPath() + ":" + oldPath;
151151
LogDebug() << newPath;
152152
setenv("PATH",newPath.toUtf8().constData(),1);
@@ -306,7 +306,7 @@ int main(int argc, char **argv)
306306
qDebug() << "preExistingToplevelIcon:" << preExistingToplevelIcon;
307307
} else {
308308
qDebug() << "iconToBeUsed:" << iconToBeUsed;
309-
QString targetIconPath = appDirPath + "/" + QFileInfo(iconToBeUsed).fileName();
309+
QString targetIconPath = appDirPath + "/" + QFileInfo(iconToBeUsed).fileName();
310310
if (QFile::copy(iconToBeUsed, targetIconPath)){
311311
qDebug() << "Copied" << iconToBeUsed << "to" << targetIconPath;
312312
QFile::copy(targetIconPath, appDirPath + "/.DirIcon");
File renamed without changes.
File renamed without changes.

Diff for: tools/tools.pro

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
TEMPLATE = subdirs
2+
CONFIG += ordered
3+
4+
SUBDIRS += linuxdeployqt

0 commit comments

Comments
 (0)