Visual Studio - Where to define custom path macros?

前端 未结 8 1783
别那么骄傲
别那么骄傲 2020-11-28 22:18

I just opened someone else\'s Visual Studio project and in their build properties they have a few custom path macro\'s they are using for their include and lib directories.

相关标签:
8条回答
  • 2020-11-28 22:53

    This link http://msdn.microsoft.com/en-us/library/a2zdt10t(v=vs.90).aspx could interest you. I didn't like the idea of changing my whole system configuration just to build a project. The most interesting part on the page is the last comment :

    This page fails to mention how to get to this dialog:

    From Property Manager, double click on a property page. Click on "User Macros" under "Common Properties" in the tree control.

    0 讨论(0)
  • 2020-11-28 22:53

    A property sheet is likely to be the right solution; this answer elaborates on @gregseth's rather than seeking to replace it, as it's too long for a comment.

    I found that I needed different paths for 32-bit and 64-bit targets, and doing that took a bit of figuring out, so I've documented the process in detail.

    One key misunderstanding I had with property sheets was that, unlike the usual VS property editor where you can edit different configuration/platform combos, a property sheet is just a list of properties. It doesn't have per-configuration and per-platform sub-sections. That was confusing because when I added a sheet to a project it appeared under each configuration/platform node rather than under the top level project node. All the entries are actually for the same property sheet file, so editing one changes all of them, but I didn't initially understand that and thought I'd still have to change the value in each place individually.

    You can add a property sheet to just one configuration/platform combo, to all of them, or to just some subset.

    If you want to have global settings then configuration/platform overrides you can do so by making sure the more specific property sheets are last. So you might have a property sheet "all configurations" then one for "x86", one for "x64" one for "debug" and one for "release". The x64 debug target would have the sheets "all", "x86", "debug". Basically emulating what VS's property editor does internally.

    0 讨论(0)
提交回复
热议问题