How to put generated files (e.g. object files) into a separate folder when using Qt/qmake?

后端 未结 2 1820
孤街浪徒
孤街浪徒 2020-12-30 01:26

I have a Qt project that uses qmake. To improve clarity and readability, I\'d like to keep the

  • source files
  • build system
  • generated files (suc
2条回答
  •  死守一世寂寞
    2020-12-30 01:51

    You can add the following lines to your *.pro file:

    DESTDIR=bin #Target file directory
    OBJECTS_DIR=generated_files #Intermediate object files directory
    MOC_DIR=generated_files #Intermediate moc files directory
    

    A list of variables is available at the following locations:

    • Qt 4.8
    • Qt 5

提交回复
热议问题