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 is messing with "Default Build Directory" setting?

Qt Creator is messing with "Default Build Directory" setting?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
8 Posts 4 Posters 193 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.
  • R Online
    R Online
    Robert Hairgrove
    wrote last edited by
    #1

    I'm not sure why, but this used to be working:

    In my global preferences, I have defined the "Default Build Directory" as follows:

    ../build/%{ActiveProject:Name}/%{Qt:Version}/%{BuildConfig:Name}
    

    The project is a TEMPLATE=subdirs project using qmake, and the project file is SBBL.pro. The project is structured like this:

    SBBL_DEV
    ├── SBBL_APP
    │   ├── 3rd_party
    │   ├── app
    │   ├──── include
    │   ├──── src
    │   ├──── SBBL.pro
    │   ├──── App.pro
    │   ├──── Libs.pro
    (etc.)
    

    Since I have things under app and 3rd_party under source code management (Fossil) in two different repositories, the idea is that when I build the project, the artifacts will stay outside of the folders which are under Fossil SCM, i.e.:

    SBBL_DEV
    ├── SBBL_APP
    │   ├── 3rd_party
    │   ├── app
    │   ├── build
    │   ├──── SBBL
    │   ├────── 6.11.0
    │   ├──────── Debug
    │   ├──────── Release
    │   ├── libs
    (etc.)
    

    When I open the project and examine the value of %{ActiveProject:Name}, this is SBBL as it should be. However, when I try to configure the project's kits, they all show build paths like this, e.g.:

    [...]/SBBL_DEV/SBBL_APP/build/6.11.0/Debug
    [...]/SBBL_DEV/SBBL_APP/build/6.11.0/Release
    [...]/SBBL_DEV/SBBL_APP/build/6.11.0/Profile
    

    The "SBBL" subfolder is missing!

    As I said, this used to be working correctly. Am I missing something?

    1 Reply Last reply
    0
    • R Online
      R Online
      Robert Hairgrove
      wrote last edited by
      #2

      I fixed this by replacing "%{ActiveProject:Name}" with just "%{Project:Name}".

      But how does one know the difference? In the list of variable replacements, they both resolve to "SBBL". Does this have to do with the "TEMPLATE=subdirs" setting?

      1 Reply Last reply
      0
      • O Offline
        O Offline
        OliverSo
        wrote last edited by
        #3

        Same problem here, since a while. I can't prove that this came with V18, but it did work properly in the past.

        The issue seems to be that during creation of a new project with the assistant the field %{ActiveProject:Name} is not set during project configuration. Therfore the build directories in the build configurations are all set wrong.

        If you add a build configuration manually in an already existing project all works as expected.

        By the way: the default build path in the preferences (if you click the "reset" button") creates a build directory under the project directory. That's in many areas a no go.

        @whomever this concerns: please fix the issue

        R 2 Replies Last reply
        1
        • aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote last edited by
          #4

          @OliverSo: This is a user forum. Please report bugs at bugreports.qt.io/QTCREATORBUG

          Thanks and regards

          Qt has to stay free or it will die.

          1 Reply Last reply
          0
          • O OliverSo

            Same problem here, since a while. I can't prove that this came with V18, but it did work properly in the past.

            The issue seems to be that during creation of a new project with the assistant the field %{ActiveProject:Name} is not set during project configuration. Therfore the build directories in the build configurations are all set wrong.

            If you add a build configuration manually in an already existing project all works as expected.

            By the way: the default build path in the preferences (if you click the "reset" button") creates a build directory under the project directory. That's in many areas a no go.

            @whomever this concerns: please fix the issue

            R Online
            R Online
            Robert Hairgrove
            wrote last edited by
            #5

            @OliverSo Thanks, I was beginning to think that nobody else had the same problem.

            I believe there is an update for QTC out there; if the bug still persists, I shall file a bug report.

            1 Reply Last reply
            0
            • O OliverSo

              Same problem here, since a while. I can't prove that this came with V18, but it did work properly in the past.

              The issue seems to be that during creation of a new project with the assistant the field %{ActiveProject:Name} is not set during project configuration. Therfore the build directories in the build configurations are all set wrong.

              If you add a build configuration manually in an already existing project all works as expected.

              By the way: the default build path in the preferences (if you click the "reset" button") creates a build directory under the project directory. That's in many areas a no go.

              @whomever this concerns: please fix the issue

              R Online
              R Online
              Robert Hairgrove
              wrote last edited by
              #6

              @OliverSo said in Qt Creator is messing with "Default Build Directory" setting?:

              The issue seems to be that during creation of a new project with the assistant the field %{ActiveProject:Name} is not set during project configuration. Therfore the build directories in the build configurations are all set wrong.

              Interesting ... when I have the project open and go to "Edit->Preferences->Build & Run" and then click on the little symbol in the edit field at the right by "Default Build Directory", I see that "%{ActiveProject:Name}" is filled in with the correct value. So you must be correct about it happening during creation of a new project.

              1 Reply Last reply
              0
              • cristian-adamC Offline
                cristian-adamC Offline
                cristian-adam
                wrote last edited by
                #7

                The issue with %{ActiveProject:Name} to be used as a default directory name, is that you need to configure the project to get the %{ActiveProject:Name}.

                But in order to configure the project, you need the path, which also references the %{ActiveProject:Name}.

                %{Project:Name} works because it's being picked from the .pro or CMakeLists.txt file.

                R 1 Reply Last reply
                1
                • cristian-adamC cristian-adam

                  The issue with %{ActiveProject:Name} to be used as a default directory name, is that you need to configure the project to get the %{ActiveProject:Name}.

                  But in order to configure the project, you need the path, which also references the %{ActiveProject:Name}.

                  %{Project:Name} works because it's being picked from the .pro or CMakeLists.txt file.

                  R Online
                  R Online
                  Robert Hairgrove
                  wrote last edited by
                  #8

                  @cristian-adam Thanks. So this is the classic "chicken or egg" problem.

                  I am wondering why this used to work, though?

                  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