Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Release mode of qmake is intermittently building in debug mode
Forum Updated to NodeBB v4.3 + New Features

[Solved] Release mode of qmake is intermittently building in debug mode

Scheduled Pinned Locked Moved General and Desktop
11 Posts 2 Posters 3.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nandhu_kp
    wrote on last edited by
    #1

    @qmake.exe unittests.pro -r -spec win32-msvc2010 "CONFIG+=release" "CONFIG+=CodeCoverage"
    jom.exe -f Makefile.release@

    When I ran these build steps from my Qt Creator 5.2.1 I get my unit test application built with debug version intermittently, I mean it is calling my real application UI in debug mode instead of my test application. I think the qmake is always forcing to build my test application in debug mode.

    The Makefile.Release for both cases are same, the only difference I see it the sequence of calls for the widgets and UI are different and even the obj files are different.

    Could someone suggest the is there any problem with the qmake in 5.2.1 opensource or I have to add arguments to fix this.

    Thanks

    NK

    1 Reply Last reply
    0
    • N Offline
      N Offline
      nandhu_kp
      wrote on last edited by
      #2

      My unittests.pro:

      @# unit test linkage
      ROOT=$$PWD/../../..
      APPS=$$ROOT/apps
      EXTERNAL=$$ROOT/external

      CUTE_TEST_DIR = $$EXTERNAL/cutetest

      debug_and_release {
      CONFIG -= debug_and_release
      CONFIG += debug_and_release
      }
      CONFIG(debug, debug|release) {
      CONFIG -= debug release
      CONFIG += debug
      }
      CONFIG(release, debug|release) {
      CONFIG -= debug release
      CONFIG += release
      }

      TEMPLATE = app
      TARGET = UnitTestSuite
      DESTDIR = ./bin
      MOC_DIR = release/.moc
      OBJECTS_DIR = ./obj
      UI_DIR = ./ui
      RCC_DIR = ./rcc
      @

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Why all that ?

        @
        debug_and_release {
        CONFIG -= debug_and_release
        CONFIG += debug_and_release
        }
        CONFIG(debug, debug|release) {
        CONFIG -= debug release
        CONFIG += debug
        }
        CONFIG(release, debug|release) {
        CONFIG -= debug release
        CONFIG += release
        }@

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • N Offline
          N Offline
          nandhu_kp
          wrote on last edited by
          #4

          These are all from a .pri file which is include in my .pro, this file is used across all of my projects, so I just copy pasted here for your ref.

          @include ($$APPS/setDebugOrRelease.pri)@

          This files has these lines,

          @debug_and_release {
          CONFIG -= debug_and_release
          CONFIG += debug_and_release
          }
          CONFIG(debug, debug|release) {
          CONFIG -= debug release
          CONFIG += debug
          }
          CONFIG(release, debug|release) {
          CONFIG -= debug release
          CONFIG += release
          }@

          1 Reply Last reply
          0
          • N Offline
            N Offline
            nandhu_kp
            wrote on last edited by
            #5

            Thanks for the reply.
            If I remove those lines from my .pro file still there are no effect.

            1 Reply Last reply
            0
            • N Offline
              N Offline
              nandhu_kp
              wrote on last edited by
              #6

              !http://oi59.tinypic.com/2s9xi4k.jpg(Makefile.Release_diffs)!
              For example:
              The diffs in the image shows the Makefile.Release for the unitesttestsuite app (Right) and real app getting called with the Makefile.Release (Left).

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Did you clean up properly after removing the CONFIG related lines ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  nandhu_kp
                  wrote on last edited by
                  #8

                  Thanks for the reply.
                  I figured out the issue to be in my cutetest.dll which was built in debug and release mode. my unittest app uses cutetest.dll

                  @qmake.exe unittests.pro -r -spec win32-msvc2010 "CONFIG+=release" "CONFIG+=CodeCoverage"
                  jom.exe -f Makefile.Debug@

                  Same .pro file as mentioned above is creating a Program Debug Database (.pdb) file in my "bin" folder instead of debug version of app.
                  could you please suggest any directions to figure out what is happening.?

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    You explicitly configure for release and then call build on the debug Makefile, that doesn't make sense.

                    If you want to call either Makefile when you want, just configure for debug and release.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • N Offline
                      N Offline
                      nandhu_kp
                      wrote on last edited by
                      #10

                      Thanks for the reply.
                      It is working now with the below changes,

                      I removed the release and added both,
                      CONFIG += dll thread debug_and_release build_all

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Good

                        Since you have your build working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved