Results 1 to 3 of 3

Thread: Best way to make 2 different programs from the same code

  1. #1
    Join Date
    May 2012
    Posts
    57
    Thanks
    11
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Best way to make 2 different programs from the same code

    Hi,
    I have made an app using qt 5.2 for android. Now I want to make two versions, one normal and one with very limited functionality.
    Can qt creator do this from the same map with code, so all I have to do is make another pro file, then use some #defines? Will there be no conflicts building the two versions? Or should I put all code in a separates map for the two projects (which isn't too much work because the limited version will be build only occasional)?
    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Best way to make 2 different programs from the same code

    You can do that with two .pro files or one .pro file with conditional sections.

    For building you should probably use two different build directories though, to ensure each program see its version of the generated object files when linking

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    Cremers (22nd March 2014)

  4. #3
    Join Date
    May 2012
    Posts
    57
    Thanks
    11
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Best way to make 2 different programs from the same code

    Thank you. I will use two profiles and different build directories.

Similar Threads

  1. Replies: 0
    Last Post: 7th December 2013, 22:24
  2. Qt 5.0.1 MinGW - programs does not launch - exited with code 0xc0000139
    By Sébastien in forum Installation and Deployment
    Replies: 8
    Last Post: 10th April 2013, 11:22
  3. How to make fewer errors at the stage of code writing. Part N3. QT.
    By Andrey_Karpov in forum General Discussion
    Replies: 0
    Last Post: 13th July 2011, 07:39
  4. Qt Creator How to make Creator be aware of the Qt source code project?
    By kartwall in forum Qt Tools
    Replies: 5
    Last Post: 27th September 2010, 08:39
  5. Help,I want to make a ruler,all the code is here
    By duduqq in forum Qt Programming
    Replies: 4
    Last Post: 22nd April 2008, 07:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.