Debug_and_release: how to get rid of autogenerated debug/release folders



  • Hey,
    my Project structure looks like this:

    @Project
    | - build
    | - debug
    | - release
    | - modules
    | - core
    |- src
    |- include
    | - tests
    | makefile
    | makefile.Debug
    | makefie.Release
    | qmake.pro@

    My qmake.pro looks like this:
    @
    CONFIG += thread build_all warn_on debug_and_release
    HEADERS + = ...
    SOURCES += ...

    CONFIG(debug, debug|release){
    ...
    }
    CONFIG(release, debug|release){
    ...
    }
    @

    everything works fine, the only problem ist that qmake generates a debug and release folder. Both of the folder i dont use. Its only a cosmetic issue. After running "qmake" my structure looks like this:

    @Project
    | - build
    | - debug
    | - release
    | - modules
    | - core
    |- src
    |- include
    | - tests

    • | - debug*
    • | - release*
      | makefile
      | makefile.Debug
      | makefie.Release
      | qmake.pro@

    how can i get rid of these two folders?

    Thanks!

    Regards



  • You should not get rid of them, really. When switching between debug and release builds, the object files will be put in the respective folders. Otherwise the builds would overwrite each others outputs, or worse, you will get mixed objects linked, leading to all kinds of trouble.



  • I have a debug and release folder under build/:
    @
    build
    | - debug
    | - release
    @

    all my files are in these two folders. That works fine.

    But qmake generates also two folders "debug" and "release" in the "/" hirarchy, so that my structure looks like:
    @
    build
    | - debug
    | - release
    debug
    release
    @

    i do not need the generated debug and release folder because all my files are send to the /build/debug and /build/release folder.

    Its only a cosmetic issue.



  • It is probably something in your top-level .pro file that makes qmake think you will generate files from there. Is it a pure TARGET = subdirs .pro file?

    qmake should not create these folders for SUBDIRS targets. Maybe you can move the current .pro file to the modules/ level or below, and use a SUBDIRS .pro file at the top?



  • I dont get your idea. Should i use two .pro files?

    I have got only one .pro file in the top-level like this:
    @
    Project
    | - build
    |- release
    |- debug
    | - modules
    | - qmake.pro
    @

    My qmake.pro looks like this:

    @
    CONFIG += thread build_all warn_on debug_and_release grouped
    TEMPLATE = lib
    ..

    CONFIG(debug, debug|release){
    DESTDIR = build/debug
    OBJECTS_DIR = buildr/debug
    TARGET= ProjectName_debug
    }

    CONFIG(release, debug|release){
    DESTDIR = build/release
    OBJECTS_DIR = build/release
    TARGET= ProjectName_release
    }
    @

    Whats wrong with my qmake.pro file?

    Thanks!



  • So, there is nothing wrong with your .pro file. But I guess that QMake generates those folders where ti thinks temporary files will be created. It is generally possible to use multiple .pro files that follow the directory structure (search for TEMPLATE=subdirs). If you split up that .pro file so that the current one sits with the sources and headers, the debug and release folders should only be generated there.



  • is there a possibillity to achieve this with only one .pro file?

    I do not want to have several .pro files. i would like that the whole configuration stays in one file, so that a person have only to edit one file.

    this bevhaivior with the generated folders is only then, when i use the "debug_and_release" flag in CONFIG +=

    Maybe i just shouldnt use this flag ?

    Thanks



  • Hi there!

    I have the same problem here. Did you find a solution?

    My qmake also generates die release/debug folders and it seems that I can't do nothing about it.

    Thanks!



  • oh, I just found the solution!

    If you set the MOC_DIR variable, then qmake does not generate the folders. My code looks like this now:

    DESTDIR = bin/debug
    OBJECTS_DIR = bin/debug
    MOC_DIR = bin/debug



  • @JamesBrown147: Watch out, these directories will now be used for debug and release builds, unless you added logic around it.



  • I got the same problem. :-( (error only on Windows no problems with Fedora )

    QDir::currentPath() is
    C:\Qt\ding\build-poppi-Desktop_Qt_5_3_MSVC2013_64bit-Debug

    but the real exe is in
    C:\Qt\ding\build-poppi-Desktop_Qt_5_3_MSVC2013_64bit-Debug\debug

    automatic created folders are
    C:\Qt\ding\build-poppi-Desktop_Qt_5_3_MSVC2013_64bit-Debug\debug
    C:\Qt\ding\build-poppi-Desktop_Qt_5_3_MSVC2013_64bit-Debug\release

    C:\Qt\ding\build-poppi-Desktop_Qt_5_3_MSVC2013_64bit-Release\debug
    C:\Qt\ding\build-poppi-Desktop_Qt_5_3_MSVC2013_64bit-Release\release



  • This post is deleted!

Log in to reply
 

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