mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-30 03:25:39 +00:00
VSProps: Support compiling Qt translation files
This commit is contained in:
parent
a4e9adad25
commit
bb56b169fc
|
@ -13,6 +13,7 @@
|
|||
<QtPluginsDir>$(QTDIR)plugins\</QtPluginsDir>
|
||||
<QtToolOutDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</QtToolOutDir>
|
||||
<QtMocOutPrefix>$(QtToolOutDir)moc_</QtMocOutPrefix>
|
||||
<QtTsOutDir>$(BinaryOutputDir)translations\</QtTsOutDir>
|
||||
<QtDebugSuffix>d</QtDebugSuffix>
|
||||
<QtLibSuffix Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='DebugFast'">$(QtDebugSuffix)</QtLibSuffix>
|
||||
<QtPluginFolder>QtPlugins</QtPluginFolder>
|
||||
|
@ -113,6 +114,9 @@
|
|||
<AvailableItemName Include="QtMoc">
|
||||
<Targets>QtMoc</Targets>
|
||||
</AvailableItemName>
|
||||
<AvailableItemName Include="QtTs">
|
||||
<Targets>QtTs</Targets>
|
||||
</AvailableItemName>
|
||||
</ItemGroup>
|
||||
|
||||
<!--Copy the needed dlls-->
|
||||
|
@ -157,4 +161,25 @@
|
|||
Overwrite="true"
|
||||
/>
|
||||
</Target>
|
||||
|
||||
<!--Compiles all translation files-->
|
||||
<ItemGroup>
|
||||
<TsFiles Include="$(MSBuildProjectDirectory)\**\*.ts" />
|
||||
</ItemGroup>
|
||||
<Target Name="QtTs"
|
||||
BeforeTargets="ClCompile"
|
||||
Inputs="@(TsFiles)"
|
||||
Condition="'@(QtTs)'!=''"
|
||||
Outputs="@(TsFiles->'$(QtTsOutDir)%(Filename).qm')">
|
||||
<Message Text="lrelease %(TsFiles.Filename)" Importance="High" />
|
||||
<Error Condition="!$(QtDirValid)" Text="QTDIR not set or non-existent (pull the submodule?)" />
|
||||
<MakeDir Directories="$(QtTsOutDir)" />
|
||||
<Exec Command=""$(QtBinDir)lrelease.exe" "%(TsFiles.FullPath)" -qm "$(QtTsOutDir)%(TsFiles.Filename).qm"" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<TsOutputs Include="$(QtTsOutDir)*.qm" />
|
||||
</ItemGroup>
|
||||
<Target Name="QtTsClean">
|
||||
<Delete Files="@(TsOutputs)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<CleanDependsOn>QtResourceClean;QtUiClean;QtMocClean;$(CleanDependsOn)</CleanDependsOn>
|
||||
<CleanDependsOn>QtResourceClean;QtUiClean;QtMocClean;QtTsClean;$(CleanDependsOn)</CleanDependsOn>
|
||||
<!--
|
||||
<ComputeLinkInputsTargets>$(ComputeLinkInputsTargets);QtComputeMocOutput;</ComputeLinkInputsTargets>
|
||||
<ComputeLibInputsTargets>$(ComputeLibInputsTargets);QtComputeMocOutput;</ComputeLibInputsTargets>
|
||||
|
|
|
@ -3,9 +3,12 @@
|
|||
<ItemType Name="QtResource" DisplayName="Qt Resource File" />
|
||||
<ItemType Name="QtUi" DisplayName="Qt User Interface File" />
|
||||
<ItemType Name="QtMoc" DisplayName="Qt Meta Object File" />
|
||||
<ItemType Name="QtTs" DisplayName="Qt Translation File" />
|
||||
<ContentType Name="QtUi" DisplayName="Qt User Interface Compiler" />
|
||||
<ContentType Name="QtResource" DisplayName="Qt Resource Compiler" />
|
||||
<ContentType Name="QtMoc" DisplayName="Qt Meta Object Compiler" />
|
||||
<ContentType Name="QtTs" DisplayName="Qt Translation Compiler" />
|
||||
<FileExtension Name="*.qrc" ContentType="QtResource" />
|
||||
<FileExtension Name="*.ui" ContentType="QtUi" />
|
||||
<FileExtension Name="*.ts" ContentType="QtTs" />
|
||||
</ProjectSchemaDefinitions>
|
Loading…
Reference in a new issue