Qt工程将编译过程文件保存到其他目录

在工程.pro里面配置如下路径,即可将编译过程文件保存到其他目录,单独留运行文件在输出目录,这样如果工程很大输出目录就干净多了:

 

CONFIG(debug, debug|release){
    MOC_DIR = "$$OUT_PWD/tmp/debug/.moc"
    OBJECTS_DIR =  "$$OUT_PWD/tmp/debug/.obj"
    UI_DIR =  "$$OUT_PWD/tmp/debug/.ui"
    RCC_DIR =  "$$OUT_PWD/tmp/debug/.qrc"
}
CONFIG(release, debug|release){
    MOC_DIR = "$$OUT_PWD/tmp/release/.moc"
    OBJECTS_DIR =  "$$OUT_PWD/tmp/release/.obj"
    UI_DIR =  "$$OUT_PWD/tmp/release/.ui"
    RCC_DIR =  "$$OUT_PWD/tmp/release/.qrc"
}

 

你可能感兴趣的:(qt)