使用 qmake 处理子目录
你好,我想在我的项目中做这样的事情
project/
--sources/ -- cpp, h
--forms/ -- ui
--build/ -- object files, mocs
--bin/ -- execute file will appear here
--scripts/ -- this folder should be copied in the bin/ folder after make
project.pro - pro-file
,我使用 qtcreator,但我没有找到类似的东西。所以我尝试自己编写 *.pro 文件。现在我有类似的东西
QT += core gui
TARGET = project
TEMPLATE = app
SOURCES += src/main.cpp\
src/mainwindow.cpp
HEADERS += src/mainwindow.h
FORMS += src/mainwindow.ui
但这还不够。所以我寻求帮助。
UPD:另外,.pro.user 中有一些用于构建目录的内容,但我认为这是错误的方式。
Hello I want to do something like this in my project
project/
--sources/ -- cpp, h
--forms/ -- ui
--build/ -- object files, mocs
--bin/ -- execute file will appear here
--scripts/ -- this folder should be copied in the bin/ folder after make
project.pro - pro-file
I use qtcreator, but I find nothing like this stuff. So I've tried to write *.pro file myself. Now I have something like
QT += core gui
TARGET = project
TEMPLATE = app
SOURCES += src/main.cpp\
src/mainwindow.cpp
HEADERS += src/mainwindow.h
FORMS += src/mainwindow.ui
But this is not enough. So I'm asking for help.
UPD: Also, there is some stuff for build dir in .pro.user, but I think it's wrong way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将其添加到文件的底部。这可以满足您所需的一切。我列出了两种将脚本复制到 bin 目录的方法。第二种方法归功于jwernerny。如果您有任何疑问,请询问。
#复制脚本的两种方法。
或者
Add this to the bottom of your file. This does everything you need. I listed two methods of copying the scripts to the bin directory. Credit for the second method goes to jwernerny. Ask if you have any questions.
#Two Methods for Copying the scripts over.
OR
我认为 qmake INSTALLS 提供了一个很好的、交叉的问题的平台解决方案,而不依赖于系统上可用的特定命令(即 cp)。它只需要运行
make install
。I think qmake INSTALLS provides a good, cross platform solution to the problem without relying on specific commands (i.e. cp) being available on the system. It only requires running
make install
.