[Visual Studio 2008-自定义构建规则]使用“输出" “命令行"中的属性财产 [英] [Visual Studio 2008 - Custom Build Rule] Use "Outputs" property in "Command Line" property

查看:84
本文介绍了[Visual Studio 2008-自定义构建规则]使用“输出" “命令行"中的属性财产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望这是一个快速简单的问题,

我正在Visual Studio 2008(针对Qt工具链)中设置自定义生成规则.有一个输出"属性,我假设该属性指定应将生成的文件移至何处.但是该工具将输出路径作为命令行参数"-o".

我拥有的规则(来自此处),都在输出"属性中指定了输出路径和命令行"属性,如下所示:

Hopefully a quick and easy question,

I am setting up a custom build rule in Visual Studio 2008 (for Qt tool-chain). There is an "Outputs" property, which i assume specifies where the built file should go. But the tool takes the output path as a command line parameter "-o".

The rules that i have (from here), specify the output path both in the "Outputs" property and the "Command Line" property, like so:

Command Line:   %QTDIR%\bin\uic.exe [Inputs] -o "[UicPrefix]$(InputName)[UicExt]"
Outputs:        [UicPrefix]$(InputName)[UicExt]



有什么办法可以避免重复并在命令行中使用Outputs变量,如下所示:



Is there any way i can avoid the duplication and use the Outputs variable in the Command Line, like so:

Command Line:   %QTDIR%\bin\uic.exe [Inputs] -o "[Outputs]"

推荐答案

(InputName)[UicExt] 输出:[UicPrefix]
(InputName)[UicExt]" Outputs: [UicPrefix]


(InputName)[UicExt]
(InputName)[UicExt]



有什么办法可以避免重复并在命令行中使用Outputs变量,如下所示:



Is there any way i can avoid the duplication and use the Outputs variable in the Command Line, like so:

Command Line:   %QTDIR%\bin\uic.exe [Inputs] -o "[Outputs]"


输出用于确定是否需要重建源(输出文件是否过时),因此,如果您未指定输出,则将跳过自定义构建".由于可以将Visual Studio宏用于所有这些值,因此在两个位置同时使用它们应该没有问题.
The outputs are used to determine whether the source needs to be rebuilt (is the output file out of date) so if you do not specify outputs the Custom Build will be skipped. Since you can use the Visual Studio macros for all these values there should be no problem in having them in both places.


这篇关于[Visual Studio 2008-自定义构建规则]使用“输出" “命令行"中的属性财产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆