Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Developer
Posts: 83
Registered: ‎10-26-2008
My Device: Z10
My Carrier: MTS UKR

One project, multiple targets

Hello,

 

I'm wondering if there is a way to setup multiple build targets inside single project to build different binaries. The idea is to have single project for Free and Pro versions.

 

Thanks

Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: One project, multiple targets

[ Edited ]

You can use conditions inside your pro (project) file.
For example:
pro file
DEFINES += PRO_VERSION

contains(DEFINES, PRO_VERSION){
// Here you can add new files for build etc
SOURCES += proversion.cpp
}else{
// Lite version
}

And in your app you can use normally MACRO condition

#ifdef PRO_VERSION
Bla bla
#endif

 

Hope it helps

 

For more info and advanced usage check this

http://qt-project.org/doc/qt-4.8/qmake-advanced-usage.html



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Developer
Posts: 83
Registered: ‎10-26-2008
My Device: Z10
My Carrier: MTS UKR

Re: One project, multiple targets

@Benecore: Thank you for reply. Is it possible to have 2 bar-descriptor.xml files (or setup application name depending on the configuration)?

Is it possible to setup separate build type using Momentics IDE, so I can easily build either Free or Pro version without modifing .pro file?

 

Thanks

Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: One project, multiple targets

1. I don't think is possible use two bar-descriptor.xml, but changing name of app depending to the PRO or LITE version, is only 10 seconds work, so....

 

2. Is possible build LITE and PRO without modifying project file, but i recomend this to you. You can use 'simple' condition inside your file

For example:

Your header file: 

const bool PRO_VERSION = true

and using conditions somewhere in your code.

 

 



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Developer
Posts: 83
Registered: ‎10-26-2008
My Device: Z10
My Carrier: MTS UKR

Re: One project, multiple targets

1. It's not only about application name, but version, icon, splash and permissions. Is it possible to have 2 bar-descriptor files (with a different names) and copy one of them into bar-descriptor.xml as pre-build stage?

 

2. The idea is to not modify source code in order to build LITE or PRO version. Maybe it is possible to create 2 projects that will use same sources and resources?

 

Thanks

Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: One project, multiple targets

[ Edited ]

Ok, i understand.

Hm, the workaround for this could be use QMAKE_POST_LINK and copy specific bar-descriptor.xml to the root of project (according target).

Not tested, but i think it could work. Tommorow i will play with this



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Developer
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: One project, multiple targets

You can make a bash script that compiles from the command line. Make it copy or move the files necessary for each of your projects and execute compilation.