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. Qt Creator: Build COnfiguration: create new configurations and seleting option depending on them?
Forum Update on Monday, May 27th 2025

Qt Creator: Build COnfiguration: create new configurations and seleting option depending on them?

Scheduled Pinned Locked Moved Qt Creator and other tools
4 Posts 3 Posters 7.0k Views
  • 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.
  • C Offline
    C Offline
    calberto
    wrote on last edited by
    #1

    I created two new build configuration "DebugTgt" and "ReleaseTGT", cloned from debug and release. I wont them build as original release and debug but linking with a different library and changing some defiles.

    I supposed a new configuration will build into a new directory i.e. <build-directory>/DebugTgt in place of the original <build-directory>/debug, but it keep building into <build-directory>/debug. I know I can change it by hand, by I wonder if there is a way to make it automatically, that is appending the build configuration name to the <build-directory> ad standard configurations do.

    I also suppose I can add to the .pro file something as:
    @
    DebugTGT {
    LIBS += myTgtLib.a
    DEFINES+= DISABLE_BOARD_SIMULATOR
    TARGET = app_for_tgt
    }
    @

    But this doesn't work (the "tgt" version should link against a library that access a PCI board, while the default configuration simple use a board simulator)

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Go to the project settings, tab build settings. There is a qmake step, which has a line for additional qmake arguments. There you shold add "CONFIG+=DebugTGT" (including the quotes) to switch on the special configuration.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • C Offline
        C Offline
        calberto
        wrote on last edited by
        #3

        Thanks, it works except that Qt Creator doesn't create a build directory for the new configuration, under the main build directory, as it does for debug and release. I have to manually change it from in the project configuration, so I suppose I have to pay attention if I move the project to another location (I have not tried yet).

        Also, the TARGET change the executable file name but the creator always try to launch it with the original name. Can be fixed in the "Run Configuration", but it seem to me it is not associated to the Build configuration so I have to change it manually then I change the configuration.

        So far, I keep the same target name, it easier.

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

          calberto: Qt Creator does not create separate build directories per configuration (yet:-).

          Debug and release are actually created by qmake based on the CONFIG used to build.

          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