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. Qt Creator 2.6.x shadow build option.
Forum Updated to NodeBB v4.3 + New Features

Qt Creator 2.6.x shadow build option.

Scheduled Pinned Locked Moved General and Desktop
18 Posts 5 Posters 9.4k 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.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on last edited by
    #2

    It should. Issue has been raised on qt-creator mailing list and I think the decision was to reintroduce this option in future release. I'm not sure if the change itself is done, though.

    (Z(:^

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sam
      wrote on last edited by
      #3

      [quote author="sierdzio" date="1358324751"]It should. Issue has been raised on qt-creator mailing list and I think the decision was to reintroduce this option in future release. I'm not sure if the change itself is done, though.[/quote]

      Thanks for the information , I even filed a bug report "QTCREATORBUG-8571":https://bugreports.qt-project.org/browse/QTCREATORBUG-8571 for this. So we can expect it to be in the qt creator 2.6.2 or 2.7.x release .

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

        This checkbox in the wizard was only shown in some cases and was missing in others (basically it only ever showed up for most desktop builds). That was very confusing (to me;), so I ended up removing it when rewriting the the target setup page of the wizard for the kits.

        Shadow-building has lots of advantages, too, so that is why we encourage its use so much: You can switch between different kinds of builds without having to clean/rebuild, you keep your source dir clean, you avoid trouble when working with different configurations, etc. It really is the good-thing(TM). Now I am sounding like a crusader;)

        You can in fact turn of shadow building from the wizard: Just set the build directory to the source directory. In 2.7 there is a way to change the default build directory in Tools>Options>Build & Run>General. Setting it to '.' will effectively turn of shadow building globally.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sam
          wrote on last edited by
          #5

          @ Tobias Hunger,

          Thanks for the information, I agree with you, for our projects it becomes easy for us to clean-up with the svn tools,so we like to uncheck the shadow build option.

          bq. You can in fact turn of shadow building from the wizard: Just set the build directory to the source directory.

          Thats a simple option which can be used , I'll give it a try.

          bq. In 2.7 there is a way to change the default build directory in Tools>Options>Build & Run>General. Setting it to ‘.’ will effectively turn of shadow building globally.

          It will be really nice to have this as it will provide more flexibility and a permanent solution to all.

          Regards
          Soumitra.

          1 Reply Last reply
          0
          • E Offline
            E Offline
            eSKon
            wrote on last edited by
            #6

            Let me describe how i was building my projects before shadow-build era.
            I had in pro files following lines:

            @debug {
            DEFINES += DEBUG
            INCLUDEPATH += GeneratedFiles/Debug
            DESTDIR = Debug
            OBJECTS_DIR = Debug
            MOC_DIR = GeneratedFiles/Debug
            UI_DIR = GeneratedFiles/Debug
            RCC_DIR = GeneratedFiles/Debug
            }
            release {
            INCLUDEPATH += GeneratedFiles/Release
            DESTDIR = Release
            OBJECTS_DIR = Release
            MOC_DIR = GeneratedFiles/Release
            UI_DIR = GeneratedFiles/Release
            RCC_DIR = GeneratedFiles/Release
            }
            @
            As you can to see such approach doesn't require rebuilding on target switching. In same time all temporary directories are in my project directory: GeneratedFiles, Debug, Release
            Usually i save my projects in my own "Work" folder. So each project there has own directory like:
            Project1
            Project2
            and so on.
            Now, with shadow build i'm forced to have in my Work folder following structure:
            Project1
            Project1-shadow-build
            ...
            I like my old decision much more than your "shadow-build" which you force people to use.
            At least i don't understand why shadow-build directory can't be project's subfolder.
            This feature is rare thing in qt which is really disappointing.

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

              I do not force people to do anything. You can do in-source builds just like before.

              1 Reply Last reply
              0
              • E Offline
                E Offline
                eSKon
                wrote on last edited by
                #8

                Sorry if my previous message was sounding like accusation, thanks to you for your work.
                Problem i can't do it during project creation - it forces me create shadow build directory and then fix all manually through project settings. + project creation dialog has issues with localization, seems like it takes localized words "Debug" and "Release" to generate shadow build directory names but replaces all localized chars in generated names with '_'. And anyway, i think this method of "encouraging" is more like "forcing". Honestly, i didn't consider it as big issue, but a little annoying

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

                  No, you can change to shadow build during project setup. Just enter the source directory and you are set.

                  1 Reply Last reply
                  0
                  • E Offline
                    E Offline
                    eSKon
                    wrote on last edited by
                    #10

                    But is it possible to enter source subfolders like i did earlier?
                    "<PROJECT_DIR>/Release" for release and "<PROJECT_DIR>/Debug" for debug?

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

                      No, qmake does not always handle that correctly:-(

                      1 Reply Last reply
                      0
                      • E Offline
                        E Offline
                        eSKon
                        wrote on last edited by
                        #12

                        Strange to listen that, because method i described above with pro file works and worked fine always

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

                          esKon: What you describe is a hack that should not be necessary if shadow building worked better. Your hack works: The source and the build directory are on the same level after all.

                          My setup is to have a /home/code/src/projectName for the sources and /home/code/build/projectName-buildname for the individual builds and that works fine, too, and does not require changes to the .pro-file for each supported type of build.

                          Both your and my approach will break projects which assume source files to be next to the build products. You could argue that doing that is wrong and the projects should get fixed, but of course we also need to provide a way to set up in-source builds. We do that, even though the checkbox is gone (just enter the source directory as build directory).

                          1 Reply Last reply
                          0
                          • E Offline
                            E Offline
                            eSKon
                            wrote on last edited by
                            #14

                            I'm just wondered why qmake can't work with shadow directories bellow source dir if it works such way with project file hacking. But perhaps there is some technical details which i can't understand until look at qmake sources.

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              astodolski
                              wrote on last edited by
                              #15

                              [quote author="Tobias Hunger" date="1358331843"]This checkbox in the wizard was only shown in some cases and was missing in others (basically it only ever showed up for most desktop builds). That was very confusing (to me;), so I ended up removing it when rewriting the the target setup page of the wizard for the kits.

                              Shadow-building has lots of advantages, too, so that is why we encourage its use so much: You can switch between different kinds of builds without having to clean/rebuild, you keep your source dir clean, you avoid trouble when working with different configurations, etc. It really is the good-thing(TM). Now I am sounding like a crusader;)

                              You can in fact turn of shadow building from the wizard: Just set the build directory to the source directory. In 2.7 there is a way to change the default build directory in Tools>Options>Build & Run>General. Setting it to '.' will effectively turn of shadow building globally.[/quote]

                              That does NOT work as described. Have you in fact used that procedure?

                              I have done the following:

                              In QtCreator 2.6.1 for Windows, double click any .pro file in a clean project. That is, one that doesn't have a .pro.user file included.

                              Configure Project page is displaying the choices available for the number of kits installed. I have checked as default: Desktop Qt 4.8.4 MSVC2010 32 bit. Underneath that are three additional checkboxes with line edit boxes containing paths:

                              Debug. Unchecked. The line edit contains a shadow path appended to the project path based on the name of the installed kit i.e. C:\Users\MyName\Documents\QtProjects\Project-build-Desktop_Qt_4_8_4_MSVC2010_32_bit-Debug

                              Release. Unchecked. Almost identical to the above but in the context of Release. i.e. substituting Release with the word Release

                              Debug. This box is checked. The line edit contains just the path to the project.

                              I click the first two checkboxes containing the shadow build paths and un-check the third i.e. the second Debug checkbox

                              I then click Configure Project.

                              On the side bar, I click Projects after the project is configured.

                              In the Build Settings, I have to uncheck the Shadow build check box for both Debug and Release configurations.

                              This is the only method I've found that allows me to build from the project folder with object and moc code appearing in its appropriate folders.

                              If I use shadow building, most times I get errors which suggest certain objects can not be found.

                              I would prefer building within the tree of the project as a global configuration. For now until fixed, we will use Visual Studio as it is far more flexible with things like build properties.

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

                                astodolski: You seem to have a in-source build lying around that Creator is picking up, so this is not a clean project at all.

                                Have you tried to change the build directory in the top two line edits? That should give exactly the same result. Please file a bug report if this does not work for you.

                                bq. If I use shadow building, most times I get errors which suggest certain objects can not be found.

                                Then your .pro-file is doing the wrong thing.

                                bq. I would prefer building within the tree of the project as a global configuration.

                                As I said above: That is an option in Qt Creator 2.7 which was released yesterday.

                                bq. For now until fixed, we will use Visual Studio as it is far more flexible with things like build properties.

                                Please use whichever tools suit your needs best!

                                I doubt Visual studio is more flexible, it does let you do more via as UI than Creator. That makes some things simpler (initial setup), but others harder (integration with other tools).

                                1 Reply Last reply
                                0
                                • A Offline
                                  A Offline
                                  astodolski
                                  wrote on last edited by
                                  #17

                                  [quote author="Tobias Hunger" date="1363953468"]astodolski: You seem to have a in-source build lying around that Creator is picking up, so this is not a clean project at all.
                                  [/quote]

                                  I don't know how you make that claim without seeing the project. This can happen on ANY project.

                                  [quote]
                                  Have you tried to change the build directory in the top two line edits? That should give exactly the same result. Please file a bug report if this does not work for you.
                                  [/quote] Why change the directory? The debug and/or release folder are created relative to the project folder. This is academic to any project.

                                  [quote]
                                  bq. I would prefer building within the tree of the project as a global configuration.

                                  As I said above: That is an option in Qt Creator 2.7 which was released yesterday.

                                  bq. For now until fixed, we will use Visual Studio as it is far more flexible with things like build properties.

                                  Please use whichever tools suit your needs best!

                                  I doubt Visual studio is more flexible, it does let you do more via as UI than Creator. That makes some things simpler (initial setup), but others harder (integration with other tools).[/quote]

                                  As far as flexibility with projects, VS is truly more flexible. If you've used it for any serious development, you would agree.

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

                                    bq. I don’t know how you make that claim without seeing the project. This can happen on ANY project.

                                    I see the code of that page in the wizard. It creates two entries for debug and release for the shadow builds and then tries to import existing builds in the source directory and in directories following the build-dir naming convention creator uses.

                                    bq. Why change the directory?

                                    I was suggesting to change the build directory to the source directory to get around the "go to project mode and disable shadow building there" part.

                                    bq. The debug and/or release folder are created relative to the project folder. This is academic to any project.

                                    Only on windows. And not all files are generated in those subfolders etiher, so the two builds can interfere with each other. Shadow builds don't do that.

                                    bq. As far as flexibility with projects, VS is truly more flexible. If you’ve used it for any serious development, you would agree.

                                    I have not seen anything in VS that could not be done in qmake/cmake/autotools/any other buildsystem. I do agree that the functionality is easier to discover in VS, but it is there in all build systems.

                                    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