Skip to content

Instantly share code, notes, and snippets.

@nu774
nu774 / gist:6683446
Last active December 23, 2015 19:29
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'">
1042c1042
< ($$temp_fd, $fname) = File::Temp->tempfile(
---
> ($$temp_fd, $fname) = File::Temp::tempfile(