Search code examples
linuxqtqmake

debug_and_release option didn't work for linux


I'm trying to build my qt-plugin in both debug and release modes under Linux OS (Ubuntu 13.10), but it seems to me qmake ignores CONFIG += debug_and_release option. I also tried to use CONFIG += build_all, but it didn't work to. When I use the same options on Windows Qt generated two output files (for example plugin.a and plugind.a), but on Linux i get just one of them. When I force QtCreator to build my project in opposite mode (debug instead of relesae) it overrides already generated target file with the one that has the same name. Where did I go wrong?


Solution

  • Maybe the problem is that in your .pro file you should have set different target directories or different target file names. I do not know why but it looks like on Windows the target file names generated into your Makefiles are different and on Linux they are not different. You can try to change either your target directory or your target file name for debug build. Try either

    CONFIG(release, debug|release) {
        TARGET = plugin
    } else {
        TARGET = plugind
    }
    

    or

    CONFIG(release, debug|release) {
        DESTDIR = release
        OBJECTS_DIR = release/.obj
        MOC_DIR = release/.moc
        RCC_DIR = release/.rcc
        UI_DIR = release/.ui
    } else {
        DESTDIR = debug
        OBJECTS_DIR = debug/.obj
        MOC_DIR = debug/.moc
        RCC_DIR = debug/.rcc
        UI_DIR = debug/.ui
    }