how to change default values for all v60 projects

Sep 8, 2011 at 5:15 PM

I have in VS 2010 for all vc++ projects the default value for the <ClCompile> <RuntimeLibrary> property set to 'MultiThreadedDebug'. Now when I change from platform toolset v100 to v60 I would like that for all projects the default value for the <ClCompile> <RuntimeLibrary> property changes from 'MultiThreadedDebug' to 'MultiThreadedDLL'. For this reason I tried placing the following propertysheet in the folder "MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\v60\ImportAfter" but this did not solve the problem:

<Project  DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <!-- The next property not changes -->
      <RuntimeLibrary>Condition="'%(RuntimeLibrary)' == 'MultiThreadedDebug' Or '%(RuntimeLibrary)' == 'MultiThreadedDebugDLL'">MultiThreadedDLL</RuntimeLibrary>
    </ClCompile>
  </ItemDefinitionGroup>
 </Project>

But so far nothing happens when I change from platformtoolset v100 to v60. All builds show 'MultiThreadedDebug' what I will have to change to 'MultiThreadedDLL' by hand.

Any suggestions please?

 

Coordinator
Sep 8, 2011 at 5:57 PM

In the import tag at the very end of Microsoft.Cpp.Win32.v60.props there is an extra period in the path wildcard. Try changing *..props to *.props and let me know whether that resolves the problem.

Sep 9, 2011 at 12:44 PM

Thank you owenwengerd for your advice, but this did not help. I removed the dot as you said and I also corrected one typo (\v70\ImportAfter to \v60\ImportAfter), but nothing changes. I really don't know how to solve this easy task.

BTW, your work is awesome, thank you very much for this tools.

Coordinator
Sep 9, 2011 at 6:38 PM

I tested with a very simple file containing no conditions, and it did work for me. Your .props file contains a syntax error in the RuntimeLibrary tag, which is probably why it fails for you. I should also mention that sometimes while testing it is necessary to close all instances of Visual Studio and restart in order to clear out cached property files. I will upload new Daffodil project files now with the path errors corrected. Please keep me posted on your progress.

Sep 14, 2011 at 1:55 PM

It is very interesting. After putting a simple propertysheet with name "Microsoft.Cpp.Win32.RuntimeLibrary.Simple.props" in the folder "MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\v60\ImportAfter" I realized that one line works and another not. Here is the propertysheet:

<Project  DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <!-- The next line not works -->
      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
      <!-- The next line works OK -->
      <PreprocessorDefinitions>_MY_SUPPORT_DEF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
  </ItemDefinitionGroup>
 </Project>

Any explanations why this is so?

P.S. Owen, please can you send me your test file? I want to try if it works on my machine. Thank you.

Coordinator
Sep 14, 2011 at 3:14 PM
Edited Sep 14, 2011 at 3:15 PM

If your effective project settings don't show as MultiThreadedDLL in the IDE, then I guess you have another property sheet overriding the setting.  Open each property sheet listed in Property Manager to see which one includes the setting.  Sorry, I already discarded my test file, but it looked pretty similar to yours except mine had no ItemDefinitionGroup condition and mine set the RuntimeLibrary to SingleThreaded.  Does that help?