Results 1 to 9 of 9

Thread: qmake bug?

  1. #1
    Join Date
    Jun 2007
    Posts
    24
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question qmake bug?

    Qt version: Qt 4.3.0
    OS: Linux

    I'm trying to separate binaries for debug and release builds. On Linux, qmake does not generate scripts for making debug versions (g++ -g). On Win32 platforms, this works perfectly fine. Am I missing something or is it a qmake bug? Thanks in advance for any workarounds.
    -------------------------------------------------------------
    qmake usage:
    qmake -makefile test.pro "CONFIG+=build_all"

    make
    ------------------------------------------------------------
    test.pro file:

    TEMPLATE = lib
    TARGET = test
    CONFIG(debug, debug|release)
    {
    DESTDIR = ../../bin/debug/plugins
    OBJECTS_DIR = ../../bin/debug/obj
    MOC_DIR = ../../bin/debug/moc
    } else
    {
    DESTDIR = ../../bin/release/plugins
    OBJECTS_DIR = ../../bin/release/obj
    MOC_DIR = ../../bin/release/moc
    }
    ----------------------------------------------------
    Last edited by jpn; 1st January 2008 at 13:10. Reason: missing tags

  2. #2
    Join Date
    Oct 2007
    Location
    Munich, Bavaria
    Posts
    144
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake bug?

    You need to add:CONFIG += debug_and_release

  3. #3
    Join Date
    Jun 2007
    Posts
    24
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qmake bug?

    Unfortunately, even that doesn't work on Linux. All i want is to generate separate binaries for "debug" so that i can step through using gdb and "release" binaries for distributing - from the same .pro file. You guys may already have a solution for this kind of build. Can someone please help?

  4. #4
    Join Date
    Oct 2007
    Location
    Munich, Bavaria
    Posts
    144
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake bug?

    Hi William,

    my posted solution DOES work on linux - thats the way I use it.
    In order to be sure that qmake really re-generates the Makefiles:
    -make clean
    -delete all make files
    -invoke qmake again

    Good luck,

    Tom

  5. #5
    Join Date
    Jun 2007
    Posts
    24
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qmake bug?

    Tom,
    Can you post your relevant .pro file code? May be there is a difference in the way that i'm using it. What is your Qt version? Thanks again.

  6. #6
    Join Date
    Oct 2007
    Location
    Munich, Bavaria
    Posts
    144
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake bug?

    here we go ...


    Good luck,

    Tom
    Attached Files Attached Files

  7. The following user says thank you to DeepDiver for this useful post:

    William Wilson (1st January 2008)

  8. #7
    Join Date
    Jun 2007
    Posts
    24
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qmake bug?

    Thanks Tom.
    It works fine with your example:
    CONFIG(debug, debug|release) {
    win32: TARGET = $$join(TARGET,,d)
    TARGET = $$join(TARGET,,,_debug)
    }
    And not with this:
    CONFIG(debug, debug|release)
    {
    DESTDIR = ../../bin/debug/plugins
    OBJECTS_DIR = ../../bin/debug/obj
    MOC_DIR = ../../bin/debug/moc
    } else {
    DESTDIR = ../../bin/release/plugins
    OBJECTS_DIR = ../../bin/release/obj
    MOC_DIR = ../../bin/release/moc
    }
    :-(
    Last edited by jpn; 2nd January 2008 at 07:36.

  9. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qmake bug?

    qmake is a bit picky when it comes to scopes. It should be
    CONFIG(debug, debug|release) {
    ...
    } else {
    ...
    }
    J-P Nurmi

  10. The following user says thank you to jpn for this useful post:

    William Wilson (4th January 2008)

  11. #9
    Join Date
    Jun 2007
    Posts
    24
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qmake bug?

    That worked. Thank you jpn!

Similar Threads

  1. Flex, Bison and qmake
    By Hydragyrum in forum Qt Programming
    Replies: 5
    Last Post: 2nd May 2011, 15:52
  2. Qt 4.3.1 & MinGW 5.1.3 & MSYS 1.0 qmake problem
    By mdecandia in forum Installation and Deployment
    Replies: 2
    Last Post: 2nd October 2008, 16:52
  3. MacOS settings
    By skaiser in forum Installation and Deployment
    Replies: 2
    Last Post: 19th July 2007, 07:47
  4. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  5. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11

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
  •  
Qt is a trademark of The Qt Company.