Results 1 to 3 of 3

Thread: Using qmake to build multiple apps and libs

  1. #1
    Join Date
    Jun 2006
    Posts
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Using qmake to build multiple apps and libs

    Brand new to QT. With my hatred (read that inability to remember syntax) of makefiles, I'm trying to port over a fairly complex hand-build build system to use qmake, one directory at a time.

    The current makefile (hand-built) generates a static library and then generates two application binaries. I've managed to get most of the big pieces to build using a qmake generated Makefile, but I can't figure out how to get it to build the static lib first, then two different applications.

    I'm sure there are some solutions that involve moving things into subdirectories and giving each binary it's own makefile, but I'd like to avoid those...this project is complicated enough, and changing one simple thing invariably complicates matters down the road, so I've learned to become choosy about rashly making structural decisions without having too much info.

    Help much appreciated.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using qmake to build multiple apps and libs

    If you don't move them to separate directories, you'll end up coding most of the makefile yourself, because main features of qmake rely on specifing the template for the build, and I don't think you can have more than one template in a single project file.

  3. #3
    Join Date
    Jun 2006
    Posts
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Using qmake to build multiple apps and libs

    I wound up specifying multiple project files, one for each library/app, and an overall "controlling" project file. The general scheme is that the main project file merely calls the other project files in order, compiling each in turn. I used the subdir directive, but did not need to actually put everything in sub-directories, merely by adding the ".pro" suffix onto the names I put in the SUBDIRS directive.

  4. The following user says thank you to marchand for this useful post:

    Cruz (2nd September 2010)

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.