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. How to separate release and debug builds?
Forum Updated to NodeBB v4.3 + New Features

How to separate release and debug builds?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 2.9k 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.
  • S Offline
    S Offline
    soroush
    wrote on last edited by
    #1

    Hi

    I would like to put binaries of release and debug build in different folders beside source code. in .pro file:

    @
    CONFIG(debug){
    DESTDIR = ./debug
    OBJECTS_DIR = debug/.obj
    MOC_DIR = debug/.moc
    RCC_DIR = debug/.rcc
    UI_DIR = debug/.ui
    }

    CONFIG(release){
    DESTDIR = ./release
    OBJECTS_DIR = release/.obj
    MOC_DIR = release/.moc
    RCC_DIR = release/.rcc
    UI_DIR = release/.ui
    }
    @

    For release builds everything is good. I have a ./release directory in root of project. But for debug build, qmake don't create a debug directory but it's name is release (again!):

    @
    qmake CONFIG+=debug CONFIG+=local // generates release and put everything in that directory
    @

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      I have this in my projects and seems to work well:
      @
      Release {
      ...
      }
      Debug {
      ...
      }
      @
      One thing I noticed with qmake is that even if you specify different output directories for debug and release it will create "debug" and "release" directories in both, but use only one of them (appropriate for the config).

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

        [quote author="Krzysztof Kawa" date="1363696030"]
        One thing I noticed with qmake is that even if you specify different output directories for debug and release it will create "debug" and "release" directories in both, but use only one of them (appropriate for the config).[/quote]

        Only on Windows.

        (Z(:^

        1 Reply Last reply
        0
        • Chris KawaC Online
          Chris KawaC Online
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          [quote author="sierdzio" date="1363696091"]
          Only on Windows.[/quote]
          ™ :)

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tobias.hunger
            wrote on last edited by
            #5

            How about using shadow builds instead of qmake hackery?

            Remove all the code you list, create a directory next to the sources and change into it. Then do "qmake ../sources/project.pro" and all the generated files should end up in the build directory.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              soroush
              wrote on last edited by
              #6

              [quote author="Tobias Hunger" date="1363699975"]How about using shadow builds instead of qmake hackery?

              Remove all the code you list, create a directory next to the sources and change into it. Then do "qmake ../sources/project.pro" and all the generated files should end up in the build directory.[/quote]

              Nope... I don't like to mix binaries and source. Unfortunately for some reasons I have to do like so.

              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