CQtDeployer/md/en/Guide.md

551 lines
28 KiB
Markdown
Raw Permalink Normal View History

2021-06-11 11:45:43 +03:00
# How to deploy
How to deploy C++ Application
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
In this article i describe deploy processes of c++/qt application with cqtdeployer.
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
## Recommendation
If you want maximum stability of your distribution and you want to run your application on different Distributions with a different versions then you need to use Qt from official [build](https://www.qt.io/download-open-source?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f-9bb5-4778-ab02-bfb62735f3e5).
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
## Case
In this case we deploy Qt GUI Application for Ubuntu 16.04,Ubuntu 18.04 and Ubuntu 20.04 ++.
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
**If you want support all distributions begin from Ubuntu 16.04 you need build and deploy you application on the older distribution (in my case it is 16.04)**
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
## Install CQtDeployer
If you want use system qt from your OS then install [classic](https://github.com/QuasarApp/CQtDeployer/releases/download/1.4.7/LinuxInstaller.run) version of the cqtdeployer.
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
```bash
wget https://github.com/QuasarApp/CQtDeployer/releases/download/1.4.7/LinuxInstaller.run
```
```
chmod +x LinuxInstaller.run
./LinuxInstaller.run
```
![CQtDeployer Setup](https://user-images.githubusercontent.com/12465465/100077575-9280a600-2e53-11eb-8d9d-d184341cfa7c.png)
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
Select latest stable version (1.4)
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
![Screenshot from 2020-11-24 12-50-54](https://user-images.githubusercontent.com/12465465/100077707-bb08a000-2e53-11eb-9838-6f896af33105.png)
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
Done.
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
If You use official qt build then you can use snap version of the cqtdeployer.
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
```
sudo snap install cqtdeployer
```
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
After install add requirement permissions.
2020-11-19 10:14:43 +03:00
```
2020-11-24 13:34:58 +03:00
sudo snap connect cqtdeployer:process-control
sudo snap connect cqtdeployer:removable-media
sudo snap connect cqtdeployer:system-backup
```
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
Done!!!
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
## Deploy Qt GUI Application
2020-11-19 10:14:43 +03:00
2021-02-22 16:41:07 +03:00
### Deploy your executable file.
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
* For Linux systems:
2021-06-10 12:23:49 +03:00
2021-05-25 10:58:33 +03:00
```bash
2021-06-09 11:29:46 +03:00
cqtdeployer -bin myexecutable
2020-11-19 10:14:43 +03:00
```
2020-11-24 13:34:58 +03:00
* For Windows systems:
2021-06-10 12:23:49 +03:00
2021-05-25 10:58:33 +03:00
```bash
2021-06-09 11:29:46 +03:00
cqtdeployer -bin myexecutable.exe -qmake C:/Qt/5.15.0/min_gw/bin/qmake.exe
2020-11-19 10:14:43 +03:00
```
2020-11-24 13:34:58 +03:00
* For crossplatform build (Linux -> Windows)
2021-06-10 12:23:49 +03:00
2021-05-25 10:58:33 +03:00
```bash
2021-06-09 11:29:46 +03:00
cqtdeployer -bin myexecutable.exe -qmake ~/crossbuildet-Qt/5.15.0/min_gw/bin/qmake
2020-11-24 13:34:58 +03:00
```
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
## Extra options
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
If you use extra libraries, just add path for cqtdeployer to used libs.
2021-06-10 12:23:49 +03:00
2021-05-25 10:58:33 +03:00
```bash
2021-06-09 11:29:46 +03:00
cqtdeployer -bin myexecutable -libDir /PathToMyExtraLibs
2020-11-19 10:14:43 +03:00
```
2020-11-24 13:34:58 +03:00
If you want find libraries recursively from libDir path, just add recursive Depth option.
2021-06-10 12:23:49 +03:00
2021-05-25 10:58:33 +03:00
```bash
2021-06-09 11:29:46 +03:00
cqtdeployer -bin myexecutable -libDir /PathToMyExtraLibs -recursiveDepth 5
2020-11-24 13:34:58 +03:00
```
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
If you application use qml, just add qmlDir option
2021-06-10 12:23:49 +03:00
2021-05-25 10:58:33 +03:00
```bash
2021-06-09 11:29:46 +03:00
cqtdeployer -bin myexecutable -libDir /PathToMyExtraLibs -recursiveDepth 5 -qmlDir /path/to/my/qml/sources
2020-11-24 13:34:58 +03:00
```
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
If you want create simple installer for your application just add gif option.
```
2021-06-09 11:29:46 +03:00
cqtdeployer -bin myexecutable -libDir /PathToMyExtraLibs -recursiveDepth 5 -qmlDir /path/to/my/qml/sources qif
2020-11-24 13:34:58 +03:00
```
2020-11-19 10:14:43 +03:00
2020-11-24 13:34:58 +03:00
If cqtdeployer not found qmake then add the -qmake option to an invoke command.
2020-11-19 10:14:43 +03:00
```
2021-06-09 11:29:46 +03:00
cqtdeployer -bin myexecutable -libDir /PathToMyExtraLibs -recursiveDepth 5 -qmlDir /path/to/my/qml/sources qif -qmake /path/to/my/qmake
2020-11-19 10:14:43 +03:00
2021-01-09 18:42:17 +03:00
```
2021-02-22 12:41:07 +03:00
# Using a live animation example from [Qt Examples](https://doc.qt.io/qt-5/qtquick-animation-example.html)
2021-06-11 10:01:28 +03:00
## Build the project as a release
2021-06-10 12:23:49 +03:00
2021-06-11 10:01:28 +03:00
Run qmake with the -r option for release build
2021-02-22 12:41:07 +03:00
2021-06-11 10:01:28 +03:00
```bash
andrei@X570-GAMING-X:~/Qt/Examples/Qt-5.152/quick/animation$ ~/Qt/5.15.2/gcc_64/binqmake -r .
```
Call your make command.
For Linux:
```bash
make -j${nproc}
```
For Windows
```bash
Qt/Tools/QtCreator/bin/jom.exe
```
Build log:
2021-06-11 09:42:07 +03:00
```bash
andrei@X570-GAMING-X:~/Qt/Examples/Qt-5.15.2/quick/animation$ make -j${nproc}
g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../../../../5.15.2/gcc_64/include -I../../../../5.15.2/gcc_64/include/QtQuick -I../../../../5.15.2/gcc_64/include/QtGui -I../../../../5.15.2/gcc_64/include/QtQmlModels -I../../../../5.15.2/gcc_64/include/QtQml -I../../../../5.15.2/gcc_64/include/QtNetwork -I../../../../5.15.2/gcc_64/include/QtCore -I. -I/usr/include/libdrm -I../../../../5.15.2/gcc_64/mkspecs/linux-g++ -o main.o main.cpp
/home/andrei/Qt/5.15.2/gcc_64/bin/rcc -name shared ../shared/shared.qrc -o qrc_shared.cpp
/home/andrei/Qt/5.15.2/gcc_64/bin/rcc -name animation animation.qrc -o qrc_animation.cpp
g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../../../../5.15.2/gcc_64/include -I../../../../5.15.2/gcc_64/include/QtQuick -I../../../../5.15.2/gcc_64/include/QtGui -I../../../../5.15.2/gcc_64/include/QtQmlModels -I../../../../5.15.2/gcc_64/include/QtQml -I../../../../5.15.2/gcc_64/include/QtNetwork -I../../../../5.15.2/gcc_64/include/QtCore -I. -I/usr/include/libdrm -I../../../../5.15.2/gcc_64/mkspecs/linux-g++ -o qrc_animation.o qrc_animation.cpp
g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../../../../5.15.2/gcc_64/include -I../../../../5.15.2/gcc_64/include/QtQuick -I../../../../5.15.2/gcc_64/include/QtGui -I../../../../5.15.2/gcc_64/include/QtQmlModels -I../../../../5.15.2/gcc_64/include/QtQml -I../../../../5.15.2/gcc_64/include/QtNetwork -I../../../../5.15.2/gcc_64/include/QtCore -I. -I/usr/include/libdrm -I../../../../5.15.2/gcc_64/mkspecs/linux-g++ -o qrc_shared.o qrc_shared.cpp
g++ -Wl,-O1 -Wl,-rpath,/home/andrei/Qt/5.15.2/gcc_64/lib -o animation main.o qrc_shared.o qrc_animation.o /home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Quick.so /home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Gui.so /home/andrei/Qt/5.15.2/gcc_64/lib/libQt5QmlModels.so /home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Qml.so /home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Network.so /home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Core.so -lGL -lpthread
```
2021-06-11 09:52:38 +03:00
2021-06-11 10:01:28 +03:00
## Find our resulting executable file
If you built the project using qtCreator, your executable file will be found one level higher in the **build-animations-Desktop_Qt_5_15_2_GCC_64bit-Release** folder. In my case, the executable file is located in the root directory of the project.
2021-06-10 12:23:49 +03:00
2021-06-11 09:42:07 +03:00
```bash
andrei@X570-GAMING-X:~/Qt/Examples/Qt-5.15.2/quick/animation$ tree
.
├── animation # Here it is.
├── animation.pro
├── animation.qml
├── animation.qmlproject
├── animation.qrc
├── basics
│ ├── animators.qml
│ ├── color-animation.qml
│ ├── images
│ │ ├── face-smile.png
│ │ ├── moon.png
│ │ ├── shadow.png
│ │ ├── star.png
│ │ └── sun.png
│ └── property-animation.qml
├── behaviors
│ ├── behavior-example.qml
│ ├── FocusRect.qml
│ ├── SideRect.qml
│ ├── tvtennis.qml
│ └── wigglytext.qml
├── doc
│ ├── images
│ │ └── qml-animations-example.png
│ └── src
│ └── animation.qdoc
├── easing
│ └── easing.qml
├── main.cpp
├── main.o
├── Makefile
├── pathanimation
│ └── pathanimation.qml
├── pathinterpolator
│ └── pathinterpolator.qml
├── qrc_animation.cpp
├── qrc_animation.o
├── qrc_shared.cpp
├── qrc_shared.o
└── states
├── qt-logo.png
├── states.qml
└── transitions.qml
10 directories, 33 files
```
2021-02-22 12:41:07 +03:00
2021-06-11 10:01:28 +03:00
## Call cqtdeployer to form the base distribution
2021-02-22 12:41:07 +03:00
2021-06-11 10:01:28 +03:00
For Linux:
2021-06-10 12:23:49 +03:00
2021-06-11 09:42:07 +03:00
```bash
cqtdeployer -bin animation -qmlDir . qif -qmake ~/Qt/5.15.2/gcc_64/bin/qmake
```
2021-06-11 09:52:38 +03:00
2021-06-11 10:01:28 +03:00
For Windows:
2021-06-10 12:23:49 +03:00
2021-06-11 09:42:07 +03:00
```bash
cqtdeployer -bin animation -qmlDir . qif -qmake ~/Qt/5.15.2/mingw_810_64/bin/qmake.exe
```
2021-06-11 10:01:28 +03:00
Deploy log:
2021-06-11 09:42:07 +03:00
```bash
andrei@X570-GAMING-X:~/Qt/Examples/Qt-5.15.2/quick/animation$ cqtdeployer -bin animation -qmlDir . qif -qmake ~/Qt/5.15.2/gcc_64/bin/qmake
Info: Deploy ...
Info: flag targetDir not used. use default target dir :/home/andrei/Qt/Examples/Qt-5.15.2/quick/animation/DistributionKit
Info: target deploy started!!
Info: copy :/home/andrei/Qt/Examples/Qt-5.15.2/quick/animation/animation
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/libqmlplugin.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/Models.2/libmodelsplugin.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/Models.2/plugins.qmltypes
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/Models.2/qmldir
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/plugins.qmltypes
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/qmldir
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/RemoteObjects/libqtqmlremoteobjects.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/RemoteObjects/plugins.qmltypes
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/RemoteObjects/qmldir
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/StateMachine/libqtqmlstatemachine.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/StateMachine/plugins.qmltypes
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/StateMachine/qmldir
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/WorkerScript.2/libworkerscriptplugin.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/WorkerScript.2/plugins.qmltypes
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQml/WorkerScript.2/qmldir
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQuick/Particles.2/libparticlesplugin.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQuick/Particles.2/plugins.qmltypes
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQuick/Particles.2/qmldir
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQuick.2/libqtquick2plugin.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQuick.2/plugins.qmltypes
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/qml/QtQuick.2/qmldir
Info: platform : libqvnc is disabled
Info: platform : libqvnc is disabled
Info: platform : libqwebgl is disabled
Info: platform : libqwebgl is disabled
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/bearer/libqconnmanbearer.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/bearer/libqgenericbearer.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/bearer/libqnmbearer.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/iconengines/libqsvgicon.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/imageformats/libqgif.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/imageformats/libqicns.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/imageformats/libqico.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/imageformats/libqjpeg.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/imageformats/libqsvg.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/imageformats/libqtga.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/imageformats/libqtiff.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/imageformats/libqwbmp.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/imageformats/libqwebp.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforms/libqeglfs.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforms/libqlinuxfb.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforms/libqminimal.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforms/libqminimalegl.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforms/libqoffscreen.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforms/libqwayland-egl.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforms/libqwayland-generic.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforms/libqwayland-xcomposite-egl.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforms/libqwayland-xcomposite-glx.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platforms/libqxcb.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platformthemes/libqgtk3.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/platformthemes/libqxdgdesktopportal.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-decoration-client/libbradient.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-client/libdmabuf-server.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-client/libdrm-egl-server.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-client/libqt-plugin-wayland-egl.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-client/libshm-emulation-server.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-client/libvulkan-server.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-client/libxcomposite-egl.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-client/libxcomposite-glx.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-server/libqt-wayland-compositor-dmabuf-server-buffer.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-server/libqt-wayland-compositor-drm-egl-server-buffer.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-server/libqt-wayland-compositor-linux-dmabuf-unstable-v1.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-server/libqt-wayland-compositor-shm-emulation-server.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-server/libqt-wayland-compositor-vulkan-server.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-server/libqt-wayland-compositor-wayland-egl.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-server/libqt-wayland-compositor-wayland-eglstream-controller.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-server/libqt-wayland-compositor-xcomposite-egl.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-graphics-integration-server/libqt-wayland-compositor-xcomposite-glx.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-shell-integration/libfullscreen-shell-v1.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-shell-integration/libivi-shell.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-shell-integration/libwl-shell.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-shell-integration/libxdg-shell-v5.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-shell-integration/libxdg-shell-v6.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/wayland-shell-integration/libxdg-shell.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/xcbglintegrations/libqxcb-egl-integration.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/plugins/xcbglintegrations/libqxcb-glx-integration.so
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Network.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5EglFSDeviceIntegration.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5XcbQpa.so.5
Info: copy :/home/andrei/CQtDeployer/1.5/lib/libicui18n.so.56
Info: copy :/usr/lib/x86_64-linux-gnu/libxcb-xinerama.so.0
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5RemoteObjects.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5QuickParticles.so.5
Info: copy :/home/andrei/CQtDeployer/1.5/lib/libicudata.so.56
Info: copy :/home/andrei/CQtDeployer/1.5/lib/libicuuc.so.56
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5QmlWorkerScript.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Widgets.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5WaylandClient.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5DBus.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Quick.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5QmlModels.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Gui.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5Svg.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/lib/libQt5WaylandCompositor.so.5
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_ar.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_bg.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_ca.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_cs.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_da.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_de.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_en.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_es.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_fi.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_fr.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_gd.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_he.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_hu.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_it.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_ja.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_ko.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_lv.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_pl.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_ru.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_sk.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_tr.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_uk.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtbase_zh_TW.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_bg.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_da.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_de.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_en.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_es.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_fi.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_fr.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_hu.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_ja.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_ko.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_lv.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_pl.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_ru.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_sk.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_tr.qm
Info: copy :/home/andrei/Qt/5.15.2/gcc_64/translations/qtdeclarative_uk.qm
Info: try deploy msvc
Info: deploy done!
Info: copy ::/shared/Distributions/Templates/Icon.png
Error: not exits
Info: [0] Parsed arguments, ok.
Info: [2] Collecting information about available packages...
Info: [4] Found subdirectory "Application"
Info: [4] - it provides the package "Application" - "1.0"
Info: [4] Copying component data for "Application"
Info: [5] Compressing data directory "bin"
Info: [21] Compressing data directory "icons"
Info: [31] Compressing data directory "lib"
Info: [11111] Compressing data directory "plugins"
Info: [11740] Compressing data directory "qml"
Info: [11786] Compressing data directory "translations"
Info: [12321] Compressing files found in data directory: ("/home/andrei/Qt/Examples/Qt-5.15.2/quick/animation/DistributionKit/defaultQIFWTemplate/packages/Application/data/animation.sh")
Info: [12321] Hash is stored in "/tmp/binarycreator-yOPMPa/Application/1.0bin.7z.sha1"
[12321] Creating hash of archive "/tmp/binarycreator-yOPMPa/Application/1.0bin.7z"
Info: [12321] Generated sha1 hash: "0af6cb9dc074407a8857403f07d13aa7d1b3c9cb"
Info: [12322] Hash is stored in "/tmp/binarycreator-yOPMPa/Application/1.0icons.7z.sha1"
[12322] Creating hash of archive "/tmp/binarycreator-yOPMPa/Application/1.0icons.7z"
Info: [12322] Generated sha1 hash: "aa938cb332bfb427a6d0280c07c204c1bb48da22"
Info: [12322] Hash is stored in "/tmp/binarycreator-yOPMPa/Application/1.0lib.7z.sha1"
[12322] Creating hash of archive "/tmp/binarycreator-yOPMPa/Application/1.0lib.7z"
Info: [12347] Generated sha1 hash: "7c3a43111e694bc82a0ab0d19a6e4d0025f17313"
Info: [12347] Hash is stored in "/tmp/binarycreator-yOPMPa/Application/1.0plugins.7z.sha1"
[12347] Creating hash of archive "/tmp/binarycreator-yOPMPa/Application/1.0plugins.7z"
Info: [12349] Generated sha1 hash: "4ed23c36835a9b62701478ab6897737dfe9dfc9a"
Info: [12349] Hash is stored in "/tmp/binarycreator-yOPMPa/Application/1.0qml.7z.sha1"
Info: [12349] Creating hash of archive "/tmp/binarycreator-yOPMPa/Application/1.0qml.7z"
Info: [12349] Generated sha1 hash: "bd44e15d2c26c8f6cb50760032eadf0241eedf43"
Info: [12349] Hash is stored in "/tmp/binarycreator-yOPMPa/Application/1.0translations.7z.sha1"
[12349] Creating hash of archive "/tmp/binarycreator-yOPMPa/Application/1.0translations.7z"
Info: [12350] Generated sha1 hash: "030e0ede0c0e058a5d5a3b6c43c6a4767119d3f1"
Info: [12350] Hash is stored in "/tmp/binarycreator-yOPMPa/Application/1.0content.7z.sha1"
Info: [12350] Creating hash of archive "/tmp/binarycreator-yOPMPa/Application/1.0content.7z"
Info: [12350] Generated sha1 hash: "acd2cd63e77971acedbcda2a65f93b2cc036025f"
Info: [12350] Copy meta data for package "Application" using "/home/andrei/Qt/Examples/Qt-5.15.2/quick/animation/DistributionKit/defaultQIFWTemplate/packages/Application/meta/package.xml"
Info: [12350] calculate size of directory "/tmp/binarycreator-yOPMPa/Application/data"
Info: [12359] Copying associated "script" file "/home/andrei/Qt/Examples/Qt-5.15.2/quick/animation/DistributionKit/defaultQIFWTemplate/packages/Application/meta/installscript.qs"
Info: [12360] done.
Info: [12360] Begin to copy configuration file and data.
Info: [12360] Copying associated "configuration" file "/home/andrei/Qt/Examples/Qt-5.15.2/quick/animation/DistributionKit/defaultQIFWTemplate/config/config.xml"
Info: [12360] done.
Info: [12360] Read dom element: <Name>animation</Name>.
Info: [12360] Read dom element: <Version>1.0</Version>.
Info: [12360] Read dom element: <Title>animation</Title>.
Info: [12360] Read dom element: <Publisher>Company</Publisher>.
[12360] Read dom element: <StartMenuDir>animation</StartMenuDir>.
[12360] Read dom element: <TargetDir>@HomeDir@/animation</TargetDir>.
Info: [12360] Read dom element: <InstallActionColumnVisible>true</InstallActionColumnVisible>.
[12360] Read dom element: <RemoveTargetDir>true</RemoveTargetDir>.
Info: [12360] Read dom element: <ControlScript>controlScript.qs</ControlScript>.
Info: [12360] Copying associated "ControlScript" file "/home/andrei/Qt/Examples/Qt-5.15.2/quick/animation/DistributionKit/defaultQIFWTemplate/config/controlScript.qs"
Info: [12360] done.
Info: [12360] Read dom element: <MaintenanceToolName>animationTool</MaintenanceToolName>.
[12360] Read dom element: <ProductUrl></ProductUrl>.
Info: [12360] done.
Info: [12362] Creating the binary
Info: [12407] Creating resource archive for "Application"
Info: [12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0bin.7z" ("61.58 KB")
[12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0bin.7z.sha1" ("40.00 bytes")
[12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0icons.7z" ("108.00 KB")
[12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0icons.7z.sha1" ("40.00 bytes")
[12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0lib.7z" ("18.08 MB")
Info: [12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0lib.7z.sha1" ("40.00 bytes")
[12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0plugins.7z" ("1.08 MB")
[12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0plugins.7z.sha1" ("40.00 bytes")
[12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0qml.7z" ("53.29 KB")
[12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0qml.7z.sha1" ("40.00 bytes")
Info: [12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0translations.7z" ("595.71 KB")
[12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0translations.7z.sha1" ("40.00 bytes")
[12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0content.7z" ("439.00 bytes")
Info: [12407] Appending "/tmp/binarycreator-yOPMPa/Application/1.0content.7z.sha1" ("40.00 bytes")
Info: [12449] Cleaning up...
```
2021-02-22 12:41:07 +03:00
2021-06-11 10:01:28 +03:00
Done. The distribution has been saved to the **DistributionKit** folder
2021-02-22 12:41:07 +03:00
```bash
2021-06-09 11:29:46 +03:00
andrei@X570-GAMING-X:~/Qt/Examples/Qt-5.15.2/quick/animation$ ./DistributionKit/Installeranimation.run
2021-02-22 12:41:07 +03:00
```
![2021-02-22 11-25-34](https://user-images.githubusercontent.com/12465465/108681955-c629a580-7500-11eb-8087-cedfa8134aae.png)
After installation, all the necessary shortcuts will be created.
![2021-02-22 11-27-11](https://user-images.githubusercontent.com/12465465/108682148-012bd900-7501-11eb-9f0b-f46fd79aef25.png)
![2021-02-22 11-29-23](https://user-images.githubusercontent.com/12465465/108682391-48b26500-7501-11eb-8d81-b430ddf97d46.png)
## Integration with QtCreator
Unfortunately, there is currently no integration with qtcreator.
The only way is to enable build target for ** qmake ** or ** cmake **
### qmake
```qmake
QT_DIR= $$[QT_HOST_BINS]
win32:QMAKE_BIN= $$QT_DIR/qmake.exe
contains(QMAKE_HOST.os, Linux):{
QMAKE_BIN= $$QT_DIR/qmake
}
deploy.commands= cqtdeployer -bin $$DESTDIR/$$TARGET -qmake $$QMAKE_BIN -libDir $$PWD -qmlDir $$PWD -recursiveDepth 5 qif
QMAKE_EXTRA_TARGETS += deploy
```
### cmake
2021-06-10 12:23:49 +03:00
2021-02-22 12:41:07 +03:00
```cmake
find_program(Q_MAKE_EXE qmake)
find_program(CQT_EXE cqtdeployer)
IF(NOT EXISTS ${CQT_EXE})
message("the cqtdeployer not exits please install the cqtdeployer and run cmake again!")
return()
endif(NOT EXISTS ${CQT_EXE})
ADD_CUSTOM_TARGET(
deploy
COMMAND cqtdeployer clear -bin ${CURENT_PROJECT} -qmake ${Q_MAKE_EXE} -libDir ${PROJECT_SOURCE_DIR} -qmlDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5
COMMENT "Deploy: cqtdeployer clear -bin ${CURENT_PROJECT} -qmake ${Q_MAKE_EXE} -libDir ${PROJECT_SOURCE_DIR} -qmlDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
```
2021-02-22 18:43:46 +03:00
The **libDir** parameter is used to set the paths to the directory paths contain dependencies of your application, and the **qmlDir** parameter is used to set the directory paths contain the qml files required by your application. In this example, the application source code root is selected by these two options.
2021-03-01 15:38:29 +03:00
The **recursiveDepth** parameter is used to set the search depth of **libDir** and **qmlDir**.
The **qif** parameter is used to create a installer using Qt Installer Framework.
2021-02-22 12:41:07 +03:00
## Integration example
Create a test project
2021-02-22 13:19:09 +03:00
```qmake
QT += quick
CONFIG += c++11
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
SOURCES += \
main.cpp
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
RESOURCES += qml.qrc
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
QT_DIR= $$[QT_HOST_BINS]
win32:QMAKE_BIN= $$QT_DIR/qmake.exe
contains(QMAKE_HOST.os, Linux):{
QMAKE_BIN= $$QT_DIR/qmake
}
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
DESTDIR=$$PWD/Build
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
deploy.commands= cqtdeployer -bin $$DESTDIR/$$TARGET -qmake $$QMAKE_BIN -libDir $$PWD -qmlDir $$PWD -recursiveDepth 5 qif
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
QMAKE_EXTRA_TARGETS += deploy
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
```
2021-02-22 12:41:07 +03:00
2. Open the project control panel
![Снимок экрана от 2021-02-22 12-15-51](https://user-images.githubusercontent.com/12465465/108687472-d09b6d80-7507-11eb-9b56-8d09d42dac5e.png)
3. Choose a release build
2021-02-22 12:41:07 +03:00
![изображение](https://user-images.githubusercontent.com/12465465/108688147-a39b8a80-7508-11eb-81b9-9a24426a94a3.png)
3. Add "Custom build step"
![изображение](https://user-images.githubusercontent.com/12465465/108687640-02143900-7508-11eb-8d1c-532afd7f6ccb.png)
4. In the "Make arguments" field, add our "deploy" deployment step
![изображение](https://user-images.githubusercontent.com/12465465/108687800-35ef5e80-7508-11eb-8f69-aec090d4baa0.png)
5. Save
6. Start the building
2021-02-22 12:41:07 +03:00
2021-02-22 13:19:09 +03:00
#### As a result, you will receive a DistributionKit folder with the installer of your application.