获取自定义构建步骤的包含目录
我想知道在使用自定义构建步骤构建文件时是否有可能获取项目包含目录的列表。
想象一下以下情况:我的项目由 A.cpp、B.cpp 和 C.blah 组成。在项目属性中的“C/C++”字段下 -> “一般”-> “其他包含目录” 我已经指定了用于 A.cpp 和 B.cpp 的包含目录列表。现在,对于C.blah,我指定了一个自定义构建工具并写入“命令行”-> “mytool.exe C.blah -I*Direcotries?* -o C.obj”。现在如何获取此步骤中为 C/C++ 指定的包含目录列表?当我单击“宏”时,没有这样的宏为我提供完整的包含列表。
有人知道实现这一目标的可能性吗?
I would like to know if there is a possibility to get the list of project's include directories when building files with custom build step.
Imagine following situation: my project consists of A.cpp, B.cpp and C.blah. In project properties under the field "C/C++" -> "General" -> "Additional Include Directories" I have specified a list of includes directories to be used for A.cpp and B.cpp. Now for C.blah I do specify a custom build tool and write into "Command Line" -> "mytool.exe C.blah -I*Direcotries?* -o C.obj". How can I now get the list of include directories specified for the C/C++ in this step? When I click on "Macros" there is no such macro giving me the full list of includes.
Is anybody aware of a possibility to achieve this goal?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我找到了答案,尽管不完整。
人们可以在属性表中指定如下内容:
这将使宏 $(ProjectIncludeDir) 可用于包含包含目录列表的自定义构建步骤。
这种方法的问题是,在此宏上不再可能进行字符串操作。例如,请考虑以下内容:
这会导致 @(ClCompile->'%(AdditionalIncludeDirectories)') 中的宏 $(ProjectIncludeDirDot)。似乎变换是在宏评估之后进行评估的,这打破了替换。如果有人知道更好的解决方案,请...
I think I found an answer, however incomplete.
One can specify in the property sheets something like this:
This will make the macro $(ProjectIncludeDir) available to the custom build steps too containing the list of include directories.
The problem with this approach that string operations are not possible on this macro anymore. For example consider following:
This results for the macro $(ProjectIncludeDirDot) in @(ClCompile->'%(AdditionalIncludeDirectories)'). It seems that transforms are get evaluated after the macro evaluation, which breaks that replacement. If somebody knows for a better solution, please...