linux 端口转发到外部:How to add pre-build step in qmake/qtcreator?

来源:百度文库 编辑:中财网 时间:2024/04/29 09:06:39

If you were to pass the version information as an included file (let's say "version.h") instead of a #define, then you could add the following to your qmake file

# Define how to create version.hversion.target = version.hversion.commands = version.depends = .gitQMAKE_EXTRA_TARGETS += versionPRE_TARGETDEPS += version.h

The first 3 lines tell how to make a new target object called "version" that generates "version.h". It is made by executing the commands "". The target is dependent on ".git"

The "QMAKE_EXTRA_TARGETS" says there is a new target known as "version".

The "PRE_TARGETDEPS" indicates that "version.h" needs to exist before anything else can be done (which forces it to be made if it isn't already made).