goldendict-ng/MSBuild/QtExtensions/lrelease.targets
Tvangeste ba94dd1314 Created a VS2012 project and solution for GoldenDict
It uses excellent Visual Studio extensions for Qt,
written by Adam Badura (@adambadura). Many thanks!

The project file is fully functional in Release-Qt4 configuration,
for both x32 and x64 architectures.

I decided not to use the official Qt Plugin, since it
generates HUGE and broken project files which is painful
to maintain.

Here we have a pure visual studio solution with proper
Visual Studio extensions to support Qt-based development.

These extensions cover RCC, Lrelease, MOC and UIC,
automagically invoking them when needed, with basically
no need for manual steps to maintain.

Also, GoldenDict can be built from the command line as well,
no Visual Studio is required:

For Win32:
MSBuild /m goldendict.sln /v:m /nologo /p:Configuration=Release-Qt4 /p:Platform=win32

For x64:
MSBuild /m goldendict.sln /v:m /nologo /p:Configuration=Release-Qt4 /p:Platform=x64
2013-08-16 15:47:12 +02:00

93 lines
2.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura and Tvangeste.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
<AvailableItemName Include="QtTranslate">
<Targets>QtTranslate</Targets>
</AvailableItemName>
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<UsingTask
TaskName="QtLrelease"
TaskFactory="XamlTaskFactory"
AssemblyName="Microsoft.Build.Tasks.v4.0">
<Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
</UsingTask>
<Target
Name="SelectQtTranslate"
DependsOnTargets="_SelectedFiles;SelectCustomBuild"
>
<ItemGroup Condition="'@(SelectedFiles)' != ''">
<QtTranslate
Remove="@(QtTranslate)"
Condition="'%(Identity)' != '@(SelectedFiles)'"
/>
</ItemGroup>
</Target>
<Target
Name="QtTranslate"
Condition="'@(QtTranslate)' != ''"
DependsOnTargets="SelectQtTranslate"
Inputs="@(QtTranslate)"
Outputs="%(OutputFile)"
>
<Message Text="LRELEASE %(QtTranslate.Identity) -> $([System.IO.Path]::GetFileName('%(QtTranslate.OutputFile)'))"
Importance="high"/>
<ItemGroup>
<QtTranslate_tlog
Include="%(QtTranslate.OutputFile)"
Condition="'%(QtTranslate.OutputFile)' != '' and '%(QtTranslate.ExcludedFromBuild)' != 'true'"
>
<Source>@(QtTranslate, '|')</Source>
</QtTranslate_tlog>
</ItemGroup>
<WriteLinesToFile
Condition="'@(QtTranslate_tlog)' != '' and '%(QtTranslate_tlog.ExcludedFromBuild)' != 'true'"
File="$(IntDir)$(ProjectName).write.1.tlog"
Lines="^%(QtTranslate_tlog.Source);@(QtTranslate_tlog-&gt;'%(Fullpath)')"
/>
<MakeDir
Directories="$([System.IO.Path]::GetDirectoryName('%(QtTranslate.OutputFile)'))"
/>
<QtLrelease
Condition="'%(QtTranslate.ExcludedFromBuild)' != 'true'"
OutputFile="%(QtTranslate.OutputFile)"
Inputs="%(QtTranslate.Identity)"
AdditionalOptions="%(QtTranslate.AdditionalOptions)"
CommandLineTemplate="%(QtTranslate.CommandLineTemplate)"
/>
</Target>
<Target
Name="QtTranslateAndInclude"
Condition="'@(QtTranslate)' != ''"
DependsOnTargets="SelectQtTranslate;QtTranslate"
>
<ItemGroup>
<ClInclude
Include="%(QtTranslate.OutputFile)"
Condition="'%(QtTranslate.ExcludedFromBuild)' != 'true'"
>
<AutoGen>True</AutoGen>
<DependentUpon>%(QtTranslate.Identity)</DependentUpon>
</ClInclude>
</ItemGroup>
</Target>
<Target
Name="_QtTranslate"
BeforeTargets="ClCompile"
DependsOnTargets="$(BeforeQtTranslateTargets);QtTranslateAndInclude;$(AfterQtTranslateTargets)"
/>
</Project>