Show example usage and restructures usage section (#139)
This commit is contained in:
@@ -18,26 +18,6 @@ Please download __linuxdeployqt-x86_64.AppImage__ from the [Releases](https://gi
|
||||
|
||||
## Usage
|
||||
|
||||
Open in Qt Creator and build your application. Run it from the command line and inspect it with `ldd` to make sure the correct libraries from the correct locations are getting loaded, as `linuxdeployqt` will use `ldd` internally to determine from where to copy libraries into the bundle.
|
||||
|
||||
__Important:__ `linuxdeployqt` deploys the Qt instance that qmake on the $PATH points to, so make sure that it is the correct one. Verify that qmake finds the correct Qt instance like this before running the `linuxdeployqt` tool:
|
||||
|
||||
```
|
||||
qmake -v
|
||||
|
||||
QMake version 3.0
|
||||
Using Qt version 5.7.0 in /tmp/.mount_QtCreator-5.7.0-x86_64/5.7/gcc_64/lib
|
||||
```
|
||||
If this does not show the correct path to your Qt instance that you want to be bundled, then adjust your `$PATH` to find the correct `qmake`.
|
||||
|
||||
Before running linuxdeployqt it may be wise to delete unneeded files that you do not wish to distribute from the build directory. These may be autogenerated during the build. You can delete them like so:
|
||||
|
||||
```
|
||||
find $HOME/build-*-*_Qt_* \( -name "moc_*" -or -name "*.o" -or -name "qrc_*" -or -name "Makefile*" -or -name "*.a" \) -exec rm {} \;
|
||||
```
|
||||
|
||||
Alternatively, you could use `$DESTDIR`.
|
||||
|
||||
```
|
||||
Usage: linuxdeployqt app-binary [options]
|
||||
|
||||
@@ -57,6 +37,41 @@ self-contained by copying in the Qt libraries and plugins that
|
||||
the application uses.
|
||||
```
|
||||
|
||||
#### Simplest example
|
||||
|
||||
Given that a desktop file should be provided with an AppImage, `linuxdeployqt` can use that to determine the parameters of the build.
|
||||
|
||||
`linuxdeployqt ./path/to/appdir/usr/share/application_name.desktop`
|
||||
|
||||
Where the _desktop_ file specifies the executable to be run (with `EXEC=`), the name of the applications and an icon.
|
||||
See [desktop file specification](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html).
|
||||
|
||||
#### Checking library inclusion
|
||||
|
||||
Open in Qt Creator and build your application. Run it from the command line and inspect it with `ldd` to make sure the correct libraries from the correct locations are getting loaded, as `linuxdeployqt` will use `ldd` internally to determine from where to copy libraries into the bundle.
|
||||
|
||||
#### QMake configuration
|
||||
|
||||
__Important:__ `linuxdeployqt` deploys the Qt instance that qmake on the $PATH points to, so make sure that it is the correct one. Verify that qmake finds the correct Qt instance like this before running the `linuxdeployqt` tool:
|
||||
|
||||
```
|
||||
qmake -v
|
||||
|
||||
QMake version 3.0
|
||||
Using Qt version 5.7.0 in /tmp/.mount_QtCreator-5.7.0-x86_64/5.7/gcc_64/lib
|
||||
```
|
||||
If this does not show the correct path to your Qt instance that you want to be bundled, then adjust your `$PATH` to find the correct `qmake`.
|
||||
|
||||
#### Remove unecessary files
|
||||
|
||||
Before running linuxdeployqt it may be wise to delete unneeded files that you do not wish to distribute from the build directory. These may be autogenerated during the build. You can delete them like so:
|
||||
|
||||
```
|
||||
find $HOME/build-*-*_Qt_* \( -name "moc_*" -or -name "*.o" -or -name "qrc_*" -or -name "Makefile*" -or -name "*.a" \) -exec rm {} \;
|
||||
```
|
||||
|
||||
Alternatively, you could use `$DESTDIR`.
|
||||
|
||||
## Using linuxdeployqt with Travis CI
|
||||
|
||||
A common use case for `linuxdeployqt` is to use it on Travis CI after the `make` command. The following example illustrates how to use `linuxdeployqt` with Travis CI. Create a `.travis.yml` file similar to this one (be sure to customize it, e.g., change `APPNAME` to the name of your application as it is spelled in the `Name=` entry of the `.desktop` file):
|
||||
|
||||
Reference in New Issue
Block a user