Results 1 to 2 of 2

Thread: qmake sessions and placing subdir outputs into global binary dir (OUT_DIR)

  1. #1
    Join Date
    Nov 2006
    Location
    Dresden, Germany
    Posts
    106
    Thanks
    9
    Thanked 12 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question qmake sessions and placing subdir outputs into global binary dir (OUT_DIR)

    Hi,

    I have a project with quite a few Qt-libraries and applications, organized in a directory structure and built using a central session file:

    Directory structure:

    Qt Code:
    1. build/Qt/MyProject.pro
    2. libs/lib1/lib1.pro
    3. libs/lib2/lib2.pro
    4. app/app1.pro
    To copy to clipboard, switch view to plain text mode 

    where MyProject.pro looks like:

    Qt Code:
    1. TEMPLATE = subdirs
    2. SUBDIRS = Lib1 Lib2 App1
    3. Lib1.file = ../../libs/lib1/lib1.pro
    4. Lib2.file = ../../libs/lib2/lib2.pro
    5. App1.file = ../../app/app1.pro
    6.  
    7. App1.depends = Lib1 Lib2
    To copy to clipboard, switch view to plain text mode 


    Now I want to use different Qt kits to test the compilation. The output directories are created like:

    Qt Code:
    1. build/build-MyProject-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug
    2. build/build-MyProject-Desktop_Qt_5_12_3_MSVC2017_64bit-Debug
    To copy to clipboard, switch view to plain text mode 

    Question:
    How can I define in my lib1.pro, lib2.pro and app1.pro files that the objects, moc, ui files etc. are all placed under the respective kit?

    app/app1.pro:

    Qt Code:
    1. OBJECTS_DIR = ???? -> should go to build/build-MyProject-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug/App1
    2. MOC_DIR = ???? -> should go to build/build-MyProject-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug/App1/moc
    3. UI_DIR = ???? -> should go to build/build-MyProject-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug/App1/ui
    To copy to clipboard, switch view to plain text mode 

    or rephrased, how do I obtain the OUT_DIR = build-MyProject-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug of the sessions project inside app1.pro ?
    Andreas

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,110
    Thanks
    290
    Thanked 844 Times in 831 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qmake sessions and placing subdir outputs into global binary dir (OUT_DIR)

    Probably not the answer you want, but CMake is good at this type of thing. You can drive it from a script with a command line argument specifying the kit you want to use, then in the CMakeLists.txt file use that argument to generate the paths to the kit and the output files. I use this method to generate multiple builds of a large hierarchy of libraries for three different compiler versions, in 32- and 64-bit, release- and debug- modes.

    I don't use Qt Creator, so I am not familiar with how you can automate builds with it. I had thought that all you had to do manually was to change the kit to use when building, and to select the appropriate kits in the kit configuration. I don't think any of this is stored in the .pro files.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. How we can maintain Sessions in the QTJambi
    By divanshu in forum Qt Programming
    Replies: 1
    Last Post: 26th August 2011, 07:35
  2. SUBDIR qmake structure
    By mrandreas in forum Newbie
    Replies: 1
    Last Post: 28th September 2010, 14:42
  3. qmake, subdirs & global vars
    By jpujolf in forum Qt Tools
    Replies: 0
    Last Post: 21st May 2009, 09:05
  4. Qhttp, is it possible to set http sessions?
    By joozt in forum Qt Programming
    Replies: 4
    Last Post: 20th August 2008, 09:20
  5. Replies: 0
    Last Post: 29th May 2007, 06:28

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.