How to specify relative paths in a .vsprops file

Can I specify a path to .vsprops files relative to the .vsprops file directory?

For example, I have a followind pointer structure:

largesolution.sln a/a.vcproj b/c/c.vcproj common/common.vsprops 

Both a.vcproj and c.vcproj include common.vsprops , and I want to add a macro or set the include directory relative to the common folder, regardless of which solution catalog both projects are included in. I tried to use $(InputDir) in the .vsprops file, but it seems that this macro is expanding as a directory containing the .vcproj file, not the .vsprops file.

Setting absolute paths or setting the global include path in Visual C ++ Directories is not a solution, because different developers have different root locations of the source tree. Setting paths relative to $(SolutionDir) not suitable, because it is useful to have smaller solutions containing some subsets of ob projects (for example, only a.vcproj) somewhere outside the main source tree.

Of course, installing an include in a directory from a.vcproj to $(ProjectDir)..\common works fine, but the result to be achieved includes only .vsprops and the correct paths.

+4
source share
1 answer

You can use the MSBuildThisFileDirectory macro. For example: You set Include Directories to "$ (MSBuildThisFileDirectory) \ include; $ (IncludePath)" in common.props.

See http://msdn.microsoft.com/en-us/library/vstudio/ms164309.aspx for more details.

Tested with MSVS2012 and MSVS2013.

+2
source

All Articles