09-04-2012 12:53 AM
Like in Android / BlackBerry Java or any other platform, the reusable components can be pushed to a library or similar Library projects to which the main project can be made depended.
Is there any similar approach of Library projects for Cascades?
09-04-2012 04:12 PM
There will be a KB article for how to achieve this task, and there are serveral ways of doing so.
One of them is as follows:
Part 1: create a cascaes project for shared/static lib.
From the qde, Create a Cascades C++ Project.
After the IDE generates the project skeleton from the project template, modify the QT project file, e.g.: the “.pro” file.
Change the line:
TEMPLATE = app
TEMPLATE = lib
You can add
CONFIG += staticlib
if you want to build static lib files not only share lib files.
Build the project, it will generate the desired lib files.
Part 2: compile the "main" cascades project to use the lib project
Edit the .pro file to update the INCLUDEPATH to add the path of the header files of the pre-built header libs.
INCLUDEPATH += <Path to the lib header files>
Edit the .pro file to update the LIBS to add the pre-built libs.
LIBS += -L<path to the libs> -l<lib name>
for example: if your object file is “/usr/someuser/workdir/libdummy.so”,
LIBS += -L/usr/someuser/workdir/ -ldummy
Part 3: bundle the libs together with the main app so that they will be deployed on the target.
You can manually add the shared lib files to the project “assets”, then manually edit the value of “LD_LIBRARY_PATH" in the bar-descriptor.xml file to contain the path pointing to the bundled shared lib files.
For example, if you copy shared lib files to the “assets/myLib”, then, you will have
<env var="LD_LIBRARY_PATH" value=" app/native/assets/myLib:/app/native/lib:/usr/lib/q
Hope this will help.
09-06-2012 09:00 AM
As far as I know, the process of creating and bundling shared libs still at least needs users' manully edit the QT project files.
However, as mentioned in the previous reply, an KB article is being created to help clarify the steps to achieve this task.