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. Change the default build path automatically
Forum Update on Monday, May 27th 2025

Change the default build path automatically

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 3 Posters 14.1k 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.
  • K Offline
    K Offline
    kortus
    wrote on 10 Jul 2013, 08:30 last edited by
    #1

    Hi together,

    please let me short explain what I mean:-) We develop applications under Windows and Linux for these systems and the phyFlex i.MX6 (linux cross compile). To handle depending projects like libs and applications I have created a meta-project (like a solution in VStudio)

    @
    TEMPLATE = subdirs
    CONFIG += ordered
    SUBDIRS = ../mwbase
    ../mwfirstgui
    @

    Very fine and it is possible to switch between the build target and debug/release with one selection, what isn't possible with QtCreator session.

    All sources and the .pro files in the version control system.

    When somebody check out the source and load the .pro file in the QtCreator the first action is to configure the project by selecting the target and input the build paths for debug and release.

    Can this step automated? Our build path is a relative path like ../qtbuild/<target>/<project>. Is there a template from which QtCreator extracts the default build path?
    I have checked the .pro.shared file but without success.

    I know that is no problem to input the right path and I complete understand why this is needed. But I know programmers, git clone; load .pro file; click configure project (don't reading the developers guide) and the results are in the wrong directory:-(

    Sorry for the long description, I hope that it is understandable what I mean, thanks.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 10 Jul 2013, 08:51 last edited by
      #2

      You can hard-code paths using qmake variables: DESTDIR, MOC_DIR, UIC_DIR, RCC_DIR, OBJECTS_DIR. See "this project":https://github.com/sierdzio/qeasyshell/blob/master/global.pri for reference - exactly as in your case, I'm using subdirs and the files are configured so that it all builds neatly by default.

      Qt Creator still has power to override some settings, you would need to disable shadow building (but here we come back to your problem - the developers don't configure their environment correctly).

      (Z(:^

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on 10 Jul 2013, 10:52 last edited by
        #3

        Don't hard-code paths!

        Go to Tools>Options>Build & Run>General and change the "Default build directory".

        Note that qmake might break in unexpected ways if the build and the source dir are not at the same level (== do not contain the same number of '/' or ''). I think your build directory is problematic.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 10 Jul 2013, 11:19 last edited by
          #4

          Tobias the guy is saying clearly that he is aiming for a solution that would not require any adjustments to be made by the developers using the project.

          (Z(:^

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kortus
            wrote on 10 Jul 2013, 12:02 last edited by
            #5

            Yes, I agree.

            I see that the only way at the moment is to change the "Default build directory" for the meta-project.

            QtCreator will create the same structure in the qtbuild directory, which is good at moment.
            Before I ask this question I have take a look to the Qt source code structure. But it looks not very easy but I will study this more as an example of a complex project.

            Target is to have minimal manual actions after clone the source from the version control system.

            1 Reply Last reply
            0

            1/5

            10 Jul 2013, 08:30

            • Login

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