Results 1 to 3 of 3

Thread: QMake Project Files....

  1. #1
    Join Date
    Feb 2009
    Posts
    29
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QMake Project Files....

    I have a structure like follows:

    Qt Code:
    1. include
    2. src
    3. src/src.pro
    4. src/<project>/<project stuff>
    5. src/<project group>/<project>/<project stuff>
    6. lib
    7. lib.debug
    To copy to clipboard, switch view to plain text mode 

    I essentially have a number of widgets/objects/etc that I'd like to bundle into a series of static libraries for other projects to link against. I'd also like this to be centralized so the developer only has to do 'qmake && make' once and all the projects (or a sub-set thereof) get built and put into the 'lib' (for release) and 'lib.debug' (for debug) as needed. Then the main application can just search that one location during its link for its required libraries that I am providing.

    I discovered the 'subdirs' template and it works very well, for the most part - allowing me to have a single point to compile the various projects. (cool). However, I am having some trouble with the release/debug side of doing the build.

    I added the following to one of the sub-projects:

    Qt Code:
    1. CONFIG += debug_and_release
    2. CONFIG(debug,debug|release) {
    3. DESTDIR = ../../lib.debug
    4. } else {
    5. DESTDIR = ../../lib
    6. }
    To copy to clipboard, switch view to plain text mode 

    However, when I ran 'qmake && make' it only put binaries in the 'lib' folder - not the 'lib.debug' folder. I also could not do a 'make debug' or 'make release' at the parent (e.g. where src.pro is located). Is there any way to correct this? I am new to do all of this in qmake this way. (I have previously written scripts to manage VC++ projects in a lot more complicated manner that retrieved and built dependencies; but new to doing this part in Qt.)

    Also, if possible, I'd rather have a line like:

    Qt Code:
    1. DESTDIR = ${baseDir}/lib
    To copy to clipboard, switch view to plain text mode 

    instead of

    Qt Code:
    1. DESTDIR = ../../lib
    To copy to clipboard, switch view to plain text mode 

    as I may have different depths involved and it would make building/modifying each project's pro file a lot simpler. Is there any variable I can use in this manner?

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMake Project Files....

    Quote Originally Posted by TemporalBeing View Post
    I added the following to one of the sub-projects:

    Qt Code:
    1. CONFIG += debug_and_release
    2. CONFIG(debug,debug|release) {
    3. DESTDIR = ../../lib.debug
    4. } else {
    5. DESTDIR = ../../lib
    6. }
    To copy to clipboard, switch view to plain text mode 
    However, when I ran 'qmake && make' it only put binaries in the 'lib' folder - not the 'lib.debug' folder. I also could not do a 'make debug' or 'make release' at the parent (e.g. where src.pro is located). Is there any way to correct this?
    You could add this to your project file
    Qt Code:
    1. CONFIG += build_all
    To copy to clipboard, switch view to plain text mode 

    alternatively, if you don't want to force both modes to be build all the time you have to put this in every project file of the hierarchy (including those with subdirs template) :
    CONFIG += debug_and_release
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Feb 2009
    Posts
    29
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMake Project Files....

    Okay - the 'debug_and_release' does manage that pretty well.

    However, how do I get a parent project to build a child project:

    mainprogram.src
    dependency/dep1/dep1.src
    dependency/dep2/dep2.src

    I've tried using 'include' but that doesn't seem to work. Right now, I have to explicitly build the dependencies before building the main program.

    This seems like something that the build system should be able to handle if told about the child dependency, but I can't figure it out.

    I have figured out how to get the dependencies to build the PRL files though the mainprogram doesn't seem to be using them despite 'link_prl' being specified...

Similar Threads

  1. making qmake create VisualStudio console app project file?
    By akos.maroy in forum Qt Programming
    Replies: 2
    Last Post: 18th August 2008, 14:45
  2. qmake project dependencies
    By akos.maroy in forum Newbie
    Replies: 1
    Last Post: 15th June 2008, 13:52
  3. visual studio project files - adding extra files
    By luf in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2008, 21:05
  4. Mac: Copy Files Build Phase and qmake...
    By kuwan in forum Qt Programming
    Replies: 4
    Last Post: 25th September 2007, 20:59
  5. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57

Tags for this Thread

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.