main
targets 49 lines 2.08 KB
Raw
1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4 <Project>
5 <Import Project="SomeVerInit.props" Condition=" '$(SomeVerInitImported)'!='true'" />
6
7 <ItemGroup Condition=" '$(IncludeSomeVerInfo)' == 'true' ">
8 <Compile Include="$(SomeVerInfoCsFile)" />
9 </ItemGroup>
10
11 <PropertyGroup Condition=" '$(Language)'=='C++' ">
12 <PrepareForBuildDependsOn>
13 $(PrepareForBuildDependsOn);
14 __SetVersionResource
15 </PrepareForBuildDependsOn>
16 </PropertyGroup>
17
18 <Target Name="__SetVersionResource"
19 Inputs="$(SomeVerInfoRcFile)"
20 Outputs="$(TargetPath)"
21 Condition=" '$(ConfigurationType)'=='Application' or '$(ConfigurationType)'=='DynamicLibrary' ">
22 <PropertyGroup>
23 <_ResourceFileType Condition=" '$(ConfigurationType)'=='Application' ">VFT_APP</_ResourceFileType>
24 <_ResourceFileType Condition=" '$(ConfigurationType)'=='DynamicLibrary' ">VFT_DLL</_ResourceFileType>
25 <Lcid Condition=" '$(Lcid)'=='' ">0x0409</Lcid>
26 <Description Condition=" '$(Description)'=='' ">$(TargetName)</Description>
27 <Title Condition=" '$(Title)'=='' ">$(Description)</Title>
28 </PropertyGroup>
29
30 <ItemGroup>
31 <ResourceCompile Include="$(SomeVerInfoRcFile)">
32 <PreprocessorDefinitions>
33 %(PreprocessorDefinitions);
34 SOMEVER_FILE_TYPE=$(_ResourceFileType);
35 SOMEVER_CODEPAGE=0;
36 SOMEVER_LCID=$([System.Convert]::ToInt32('$(Lcid)', 16));
37 SOMEVER_VERSION_BLOCK=$([System.Convert]::ToString($([MSBuild]::Multiply($([System.Convert]::ToUint64('$(Lcid)', 16)), 65536)), 16).PadLeft(8, '0'));
38 SOMEVER_COMPANY=$(Company);
39 SOMEVER_COPYRIGHT=$(Copyright);
40 SOMEVER_TITLE=$(Title);
41 SOMEVER_PRODUCT=$(Product);
42 SOMEVER_INTERNAL_NAME=$(TargetName);
43 SOMEVER_FILE_NAME=$(TargetFileName);
44 </PreprocessorDefinitions>
45 </ResourceCompile>
46 </ItemGroup>
47 </Target>
48
49 </Project>