Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Windows: qMake: descrepancy between "Build Configuration" and "CONFIG()" TYPE?
Forum Updated to NodeBB v4.3 + New Features

Windows: qMake: descrepancy between "Build Configuration" and "CONFIG()" TYPE?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
5 Posts 2 Posters 727 Views 2 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by
    #1

    In my project's build settings, i have this:
    0_1535743574536_Parallels DesktopScreenSnapz001.png

    and this:
    0_1535743582454_Screen Shot 2018-08-31 at 12.15.55 PM.png

    (I also have a "release" config, where "qmake build configuration" is set to "Release")

    It is my understanding that %{CurrentBuild:Name} is in fact the "build configuration" name. Right?

    So far so good. In my qMake file i have this:

    CONFIG(release, debug|release) {
    	build_type = release
    } else {
    	build_type = debug
    }
    
    message(build_type: $${build_type})
    message($${TARGET} $${build_depth}bit)
    

    I'm under the impression that that will basically get me the value of the "qmake build configuration" popup, (lower cased) is this a correct assumption?

    As expected then, when editing the qMake file, it gets re-parsed and i see something consistent like this:

    Project MESSAGE: build_type: debug
    Project MESSAGE: CFTest Debug 64bit
    

    or this:

    Project MESSAGE: build_type: release
    Project MESSAGE: CFTest 64bit
    

    However, when i go to BUILD, for some reason the qMake file gets parsed THREE times, and on the THIRD time, the two messages CONFLICT! See below:

    Project MESSAGE: ------------------------------
    Project MESSAGE: build_type: debug
    Project MESSAGE: CFTest Debug 64bit
    Project MESSAGE: ------------------------------
    Project MESSAGE: build_type: debug
    Project MESSAGE: CFTest Debug 64bit
    Project MESSAGE: ------------------------------
    Project MESSAGE: build_type: release
    Project MESSAGE: CFTest Debug 64bit
    

    why would they conflict? how is that possible? i'm concerned that this is causing an invisible problem.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #5

      it seems the THIRD one must be for the "main" Makefile, which is not "debug" so my logic marks it as "release" even though the $${TARGET}} is "debug". That would explain why the discrepancy.

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #2

        This is normal for qmake on Windows: it runs 3 times and generates 3 Makefiles. Some more information: https://stackoverflow.com/questions/17360553/qmake-processes-my-pro-file-three-times-instead-of-one

        (Z(:^

        1 Reply Last reply
        2
        • D Offline
          D Offline
          davecotter
          wrote on last edited by
          #3

          thanks for that but why the discrepancy on the third pass? is that expected? if so, why?

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #4

            One is for the main Makefile, the second is for debug build and the last one for release build.

            (Z(:^

            1 Reply Last reply
            2
            • D Offline
              D Offline
              davecotter
              wrote on last edited by
              #5

              it seems the THIRD one must be for the "main" Makefile, which is not "debug" so my logic marks it as "release" even though the $${TARGET}} is "debug". That would explain why the discrepancy.

              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