举例,从源文件件下复制指定文件到编译目录文件夹
https://doc.qt.io/qt-5/qmake-advanced-usage.html#installing-files 官方文档
这种方式需要执行 make install
system(命令) //system(mkdir xx)
可以在编译的时候执行 Uinx 下的指令
https://dragly.org/2013/11/05/copying-data-files-to-the-build-directory-when-working-with-qmake/ 参考文档
copydata.commands = cp $$PWD/路劲/*.h $$OUT_PWD/目标文件夹
first.depends = $(first) copydata
export(first.depends)
export(copydata.commands)
QMAKE_EXTRA_TARGETS += first copydata
其中 DESTDIR 指定生成文件的存放路径(在编译输出文档下)
DESTDIR = lib ;// $$OUT_PWD/lib