Qt4 使用qmake处理子曲面

Qt4 使用qmake处理子曲面,qt4,qt-creator,qmake,Qt4,Qt Creator,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,但我找不到类

你好,我想在我的项目中做类似的事情

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:另外,build dir in.pro.user中有一些东西,但我认为这是错误的方法。

将其添加到文件的底部。这是你需要的一切。我列出了将脚本复制到bin目录的两种方法。第二种方法归功于jwernerny。如果你有任何问题,请提问

DESTDIR= ./bin          #adds the exe to bin
MOC_DIR = ./build       # Deals with MOCS
OBJECTS_DIR = ./build   #deals with objects
#复制脚本的两种方法

dist.commands += cp -r ./scrpits ./bin 

将其添加到文件的底部。这是你需要的一切。我列出了将脚本复制到bin目录的两种方法。第二种方法归功于jwernerny。如果你有任何问题,请提问

DESTDIR= ./bin          #adds the exe to bin
MOC_DIR = ./build       # Deals with MOCS
OBJECTS_DIR = ./build   #deals with objects
#复制脚本的两种方法

dist.commands += cp -r ./scrpits ./bin 
或 我认为它提供了一个很好的跨平台解决方案,无需依赖系统上可用的特定命令(即cp)。它只需要运行
makeinstall

script_install.path = ./build
script_install.files = ./scripts/*
INSTALLS += script_install
我认为它提供了一个很好的跨平台解决方案,无需依赖系统上可用的特定命令(即cp)。它只需要运行
makeinstall

script_install.path = ./build
script_install.files = ./scripts/*
INSTALLS += script_install

要放置可执行文件,请添加行:DESTDIR=bin谢谢,但主要问题是将dir脚本/移动到bin/中。Make可以做到这一点,但我并不真正了解qmake。要放置可执行文件,请添加以下行:DESTDIR=bin谢谢,但主要问题是将dir脚本/移动到bin/中。Make可以做到这一点,但我不太了解qmake。这可能适用于具有“cp”的系统$$QMAKE\u COPY或$$QMAKE\u COPY\u DIR(在QMAKE.conf中为当前QMAKESPEC定义)将更易于传输。另一个解决方案是使用安装。这可能适用于具有“cp”的系统$$QMAKE\u COPY或$$QMAKE\u COPY\u DIR(在QMAKE.conf中为当前QMAKESPEC定义)将更易于传输。另一个解决方案是使用安装。