CQtDeployer
CQtDeployer copied to clipboard
Add more functionality to the extraData option
Problem:
For now there is no direct way to copy extra files(plugin libs in my case) into the special folder. And it copies files and folders into the target directory's root. I copy using qmake into the special folder and add path to it into extraData. Like this:
COPIES += myPlugins
myPlugins.files = $$files($$OUT_PWD/lib*.so*)
myPlugins.path = $$files($$OUT_PWD/plugins/myPlugins)
...
cqtdeployer -extraData $$OUT_PWD/plugins/myPlugins ....
My project tree:
buildFolder
|- application
|- plugins -> copy into $$PWD/packages/application.package/data/application/myPlugins
|- (*.so, *.a, *.lib, *.dll)
|- (other build files not needed in installer)
|- morePlugins -> copy into $$PWD/packages/application.package/data/application/myPlugins
|- (*.so, *.a, *.lib, *.dll)
|- (other build files not needed in installer)
rootFolder
|- installer
|- packages
|- application.package
|- data
|- application
|- myPlugins
|- (*.so, *.a, *.lib, *.dll)
|- meta
Suggestion
Expand extraData with the syntax below:
-extraData {$$OUT_PWD/plugins/libPluginName.so,myPlugins/libPluginNewName.so},{$$OUT_PWD/plugins/libSecondPluginName.so,myPlugins/libSecondPluginNewName.so},{$$OUT_PWD/plugins/libThirdPluginName.so}
Did I understand you correctly? Do you want cqtdeployer to add not all files to the myPlugins folder, but only with the extensions you need
Did I understand you correctly? Do you want cqtdeployer to add not all files to the myPlugins folder, but only with the extensions you need
No, not only filtering file extensions. Also I need to copy them into the folder myPlugins in package's data folder.
I will add more information to the issue now.
@EndrII think it's OK now
hm you need to collect all plug-ins files (*.so, *.a, *.lib, *.dll) into one custom folder without save structure of the input directory ? right?
hm you need to collect all plug-ins files (*.so, *.a, *.lib, *.dll) into one custom folder without save structure of the input directory ? right?
Yeah. I want to collect them into one custom folder in component's folder. For now I first copy all files into one folder using qmake and after copying I call cqtdeployer with giving it path to folder and it copies it to the data folder. I just want to avoid excess file copying in my projects.
Of course, It can be avoided by changing DESTDIR in .pro files for plugins but it adds dependencies to subprojects so that they cannot be freely used in other projects.
try the extraDataOut option. This option sets relative path to an output directory of an extra data
cqtdeployer -extraData $$OUT_PWD/plugins/libPluginName.so,$$OUT_PWD/plugins/libSecondPluginName.so,$$OUT_PWD/plugins/libThirdPluginName.so -extraDataOut myPlugins
@kartaris the fact is that I do not yet know how to make cqtdeployer make a selection for certain files. Here I would like to introduce a new concept "Selector" and it will take a lot of time to implement.
I can try to add it myself)
I can try to add it myself)
you can try to do it yourself, but the option that you suggested introducing the new syntax into the arguments, I'm afraid it will take a lot of time and can break a lot.
try the extraDataOut option. This option sets relative path to an output directory of an extra data
cqtdeployer -extraData $$OUT_PWD/plugins/libPluginName.so,$$OUT_PWD/plugins/libSecondPluginName.so,$$OUT_PWD/plugins/libThirdPluginName.so -extraDataOut myPlugins
@kartaris it looks very similar to what you are suggesting, why doesn't it suit you?
try the extraDataOut option.
This option sets relative path to an output directory of an extra data
cqtdeployer -extraData $$OUT_PWD/plugins/libPluginName.so,$$OUT_PWD/plugins/libSecondPluginName.so,$$OUT_PWD/plugins/libThirdPluginName.so -extraDataOut myPlugins
It puts all extraData into one folder. I have other files to be added into the root folder and another folders there.
use the separate packages for solve this issue.
cqtdeployer -extraData extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5 -extraDataOut extraDataPackage;MyEstraDir1,extraDataPackage2;MyEstraDir2 -prefix extraDataPackage1;"",extraDataPackage2;""
-
This we create a two packages extraDataPackage1 and extraDataPackage2 -extraData extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5
-
This we set for created packages custom out directories
-extraDataOut extraDataPackage;MyEstraDir1,extraDataPackage2;MyEstraDir2 -
This we reset prefixes of new packages because by default is equals a package name -prefix extraDataPackage1;"",extraDataPackage2;""
or use a config file
{
"targetPackage": [
[ "extraDataPackage1" ], [ "extraDataPackage2" ]
],
"extraData": [
[
"extraDataPackage1",
"MyExtraData1",
"MyExtraData2",
"MyExtraData3"
],
[
"extraDataPackage2",
"MyExtraData4",
"MyExtraData5"
]
],
"prefix": [
[ "extraDataPackage1", "" ],
[ "extraDataPackage2", "" ]
],
"extraDataOut": [
[ "extraDataPackage1", "MyExtraDir1" ],
[ "extraDataPackage2", "MyExtraDir2" ]
]
}
use the separate packages for solve this issue.
cqtdeployer -extraData extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5 -extraDataOut extraDataPackage;MyEstraDir1,extraDataPackage2;MyEstraDir2 -prefix extraDataPackage1;"",extraDataPackage2;""* This we create a two packages extraDataPackage1 and extraDataPackage2 **-extraData extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5** * This we set for created packages custom out directories **-extraDataOut extraDataPackage;MyEstraDir1,extraDataPackage2;MyEstraDir2** * This we reset prefixes of new packages because by default is equals a package name **-prefix extraDataPackage1;"",extraDataPackage2;""**
in this case, you may also need to initialize the packages before adding extraData for them
cqtdeployer -targetPackage extraDataPackage1,extraDataPackage2 -extraData extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5 -extraDataOut extraDataPackage;MyEstraDir1,extraDataPackage2;MyEstraDir2 -prefix extraDataPackage1;"",extraDataPackage2;""
I'm sorry, but these examples are not working due to minor inaccuracies i prepare example for you with deploy script and extra data files.
check this please
cqtdeployer -targetPacakge "extraDataPackage1,extraDataPackage2" -extraData "extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5" -extraDataOut "extraDataPackage1;MyEstraDir1,extraDataPackage2;MyEstraDir2" -prefix "extraDataPackage1;/,extraDataPackage2;/" allowEmptyPackages
I'm sorry, but these examples are not working due to minor inaccuracies
i prepare example for you with deploy script and extra data files.
check this please
cqtdeployer -targetPacakge "extraDataPackage1,extraDataPackage2" -extraData "extraDataPackage1;MyExtraData1;MyExtraData2;MyExtraData3,extraDataPackage2;MyExtraData4;MyExtraData5" -extraDataOut "extraDataPackage1;MyEstraDir1,extraDataPackage2;MyEstraDir2" -prefix "extraDataPackage1;/,extraDataPackage2;/" allowEmptyPackages
Thanks. I will try, maybe it's something what I need.
@kartaris my suggestion help you? if yes please close this issue.
@kartaris I Think than you suggestion is very good. i want to add more functionality for the extraData option and remove the extraDataOut option. Example:
{
"extraData": ["myTarget/path:releative/put/path"]
}
Hello Endrll, unfortunately I still struggle with these options. According to your suggestion it is possible to create a separate (deb) package for the extra data but it means that one need to install it separately. Also I defined 2 extra data packages but only one of them created. It is also not allowed to copy to system directories only to /opt -> -prefix "extraDataPackage1;/" will copy package to /opt directory.
What I would like to achieve is
- configurable target location of different extra data, folders or files without the need of installing multiple deb packages
- be able to place specific files to system dirs : eg. /etc/udev/rules.d/
What do you suggest?
thanks
@lzalanyi you can use the extraData and extraDataOut options
cqtdeployer -extraData "path/to/extra/data/folder" -extraDataOut "releative/path/of/your/package/root/dir"
extraDataOut can contain ".." Dir, but it can work only for deb packages.