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. What is the "The build directory needs to be at the same level as the source directory" warning?
Forum Updated to NodeBB v4.3 + New Features

What is the "The build directory needs to be at the same level as the source directory" warning?

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

    Hello.

    The source code of my Qt projects is under subversion. By default, Qt Creator defines "Build directory" at the same level as project folder". For example, if my project is placed in /users/eye/work/testproject, the Qt Creator will use a build folder /users/eye/work/testproject-build-desktop. This is not very good since it messes the source tree and "unversioned" files under source control. So i defined a build folder to /tmp/testproject. All works fine, but during build i receive "The build directory needs to be at the same level as the source directory". Why such restriction and why build still successful?

    1 Reply Last reply
    1
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      It might just be the case that having the build dir on different level is untested, or could cause problems with relative paths.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

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

      1 Reply Last reply
      0
      • E Offline
        E Offline
        eyeofhell
        wrote on last edited by
        #3

        Paths relative to the source folder will cause problems anyway?
        Maybe i need to report a problem to Qt bugtracker on this issue?

        1 Reply Last reply
        0
        • AlicemirrorA Offline
          AlicemirrorA Offline
          Alicemirror
          wrote on last edited by
          #4

          I had the same problem. Try to solve creating a build directory, separate but at the same level of the project:

          /usr/home/QTDevel/Project dir/sources -> for sources under version control
          /usr/home/QTDevel/Project fir/build_dir -> for debug and release builds

          Although if you have folders of files in the same version-control directory is not a real problem. It is a thing that happens usually in a lot of other environments and this is solved with, i.e. in git, exist the file .gitignore

          Enrico Miglino (aka Alicemirror)
          Balearic Dynamics
          Islas Baleares, Ibiza (Spain)
          www.balearicdynamics.com

          1 Reply Last reply
          0
          • E Offline
            E Offline
            eyeofhell
            wrote on last edited by
            #5

            Yes, i know that it's a lot of ways to ignore intermediate files in source control, scripts etc. But it's a good practice to keep a source tree clean from intermediate files :). So i'm trying to figure out that is the real problem and why Qt wants intermediate folder to be at same level as source folder O_O.

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

              Qt does not care where you build, it is qmake that sometimes has trouble
              In some places qmake messes up pathes when the directories are at a different level. IIRC that was mostly related to resource file handling.

              The build will fail if this happens without any proper indication to the root cause. That is why I added this warning.

              Qmake does not care where the project is located, just how "far away" from / it is. Using /tmp/eye/work/testproject should work fine.

              PS: There is a bug report open for this issue, can't find it right now though.

              1 Reply Last reply
              1
              • AlicemirrorA Offline
                AlicemirrorA Offline
                Alicemirror
                wrote on last edited by
                #7

                Thank you for this great advice, Tobias. Now all is clear.

                Enrico Miglino (aka Alicemirror)
                Balearic Dynamics
                Islas Baleares, Ibiza (Spain)
                www.balearicdynamics.com

                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