QtCreator Project settings create debug and release folders



  • I have separate folders for Debug and Release in my Project settings. What is confusing is that in each folder qtCreator creates both "debug" and "release" subfolders(for example Project-debug/debug and Project-debug/release). Depending on the build mode, i.e debug or release, one of these subfolders is filled with obj and output files, leaving another one empty. For example, building in Debug mode creates Debug\debug with output files and Debug\release empty. My pro file does not do anything to create these subfolder.

    Why these subfolders even exist in the project build directory?


  • Moderators

    @toran "I have separate folders for Debug and Release in my Project settings" - can you explain a bit what they are used for?
    Usually you do not have to care about debug and release folders - they are created for you. Can you show your pro file?



  • "can you explain a bit what they are used for": well, sort of. QtCreator creates the default directory for a project. For example, creating console application "creatorFolderTest" in c:\test produces following setting:

    for "Debug" build configuration: C:\test\build-creatorFolderTest-Desktop_Qt_5_7_0_MSVC2015_32bit-Debug

    for "Release" build configuration: C:\test\build-creatorFolderTest-Desktop_Qt_5_7_0_MSVC2015_32bit-Release

    I did not edit .pro file in any way, just ran New Project wizard.

    Now, when I build, say, in Debug Mode, it creates "debug" and "release" folders under C:\test\build-creatorFolderTest-Desktop_Qt_5_7_0_MSVC2015_32bit-Debug.
    Please note that I did not yet build "Release" mode.

    The pro file created by QtCreator is:
    QT += core
    QT -= gui

    CONFIG += c++11

    TARGET = creatorFolderTest
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += main.cpp


  • Qt Champions 2016

    @toran
    Hi
    Just to make sure im not misunderstanding you.
    ** You are wondering ( as others before you) that when you Select a Debug build u also get release folder AND reverse. ** Yes?



  • @mrjj Oh, my... Yes, that's exactly my question. I'll appreciate it if you can provide me with the link to the answer :).


  • Qt Champions 2016

    Well I dont know the answer yet :)
    I also wondered why. :)

    I feel this time we are lucky and someone will tell us the truth.
    It's out there, I can feel it.


  • Moderators

    @mrjj @toran

    IIRC it has to do because there are different tools involved. For creator it has been decided to allow for shadow builds for all generated information. Those shadow builds are separated for debug and release. However, the file structure internally stems from a stripped down version of qmake used within creator. qmake would generate those folders in the decided location as will the stripped down version in creator.

    For some reason the shadow builds have to be already separated and cannot simply use the use the qmake structure.

    I believe there has been a post or better an answer to a post by @tobias-hunger explaining that a couple of years back. The introduction of shadow builds goes back to tobias as far as I know. However, I was not able to dig out his answer by the search functionality here in the forum.

    Do not nail me to explanation above. Completely out of memory on what I understood at that time.


  • Qt Champions 2016

    Well good enough explanation for me. Thank you.
    I absolutely adore shadow build so it's a small price to pay. :)


  • Lifetime Qt Champion

    Hi,

    Also, IIRC, that's how VS works thus the duplicated unused folders.


  • Moderators

    @SGaist

    Isn't that because of vsaddins?
    Probably the stripped stems from there somehow.

    Unfortuntely Tobias message vanished in the forum's nirwana.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.