Skip to content

Instantly share code, notes, and snippets.

@nu774
Last active December 23, 2015 19:29
Show Gist options
  • Save nu774/6683446 to your computer and use it in GitHub Desktop.
Save nu774/6683446 to your computer and use it in GitHub Desktop.
How to configure toolset specific settings on shared MSBuild user props

How to configure toolset specific settings on shared MSBuild user props

Problem

User defined props for MSBuild stored in %LOCALAPPDATA%\Microsoft\MSBuild\v4.0 are shared by all PlatformToolset configurations (v90, v100, v110..). This can be a problem when you want toolset specific setting, especially for LibraryPath.

Solution

Use Condition attibute like the following:

    <LibraryPath Condition="'$(PlatformToolset)'=='v90'">
      $(LibraryPath);/path/to/vc9/specific/libs
    </LibraryPath>
    <LibraryPath Condition="'$(PlatformToolset)'=='v100'">
      $(LibraryPath);/path/to/vc10/specific/libs
    </LibraryPath>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment