mirror of https://github.com/PCSX2/pcsx2.git
MSBuild: Adjust how MSBuild handles Qt ui files
This commit is contained in:
parent
a9e963e84b
commit
862f19eaeb
|
@ -59,23 +59,37 @@
|
|||
<Delete Files="@(ResFiles->'$(QtToolOutDir)qrc_%(Filename).cpp')" />
|
||||
</Target>
|
||||
|
||||
<!--Passes all .ui files to uic and puts output in the build directory-->
|
||||
<ItemGroup>
|
||||
<UiFiles Include="$(MSBuildProjectDirectory)\**\*.ui" />
|
||||
</ItemGroup>
|
||||
<!--Passes .ui files to uic and puts output in the build directory-->
|
||||
<!--We need to create tlogs so that VS knows the ui files are used-->
|
||||
<!--See https://learn.microsoft.com/en-us/visualstudio/extensibility/visual-cpp-project-extensibility?view=vs-2022#tlog-files-->
|
||||
<Target Name="QtUi"
|
||||
BeforeTargets="ClCompile"
|
||||
Inputs="@(UiFiles)"
|
||||
Condition="'@(QtUi)'!=''"
|
||||
Outputs="@(UiFiles->'$(QtToolOutDir)ui_%(Filename).h')">
|
||||
<Message Text="uic %(UiFiles.Filename)" Importance="High" />
|
||||
Condition="'@(QtUi)'!=''">
|
||||
<Error Condition="!$(QtDirValid)" Text="Qt directory non-existent (download/extract the zip)" />
|
||||
<MakeDir Directories="$(QtToolOutDir)" />
|
||||
<Exec Command=""$(QtHostBinDir)uic.exe" "%(UiFiles.FullPath)" -o "$(QtToolOutDir)ui_%(UiFiles.Filename).h"" />
|
||||
</Target>
|
||||
<!--Setup metadata for following tasks-->
|
||||
<ItemGroup>
|
||||
<QtUi>
|
||||
<Message>uic %(Filename)</Message>
|
||||
<Command>
|
||||
"$(QtHostBinDir)uic.exe" "%(FullPath)" -o "$(QtToolOutDir)ui_%(Filename).h"
|
||||
</Command>
|
||||
<Outputs>$(QtToolOutDir)ui_%(Filename).h</Outputs>
|
||||
</QtUi>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="QtUiClean">
|
||||
<Delete Files="@(UiFiles->'$(QtToolOutDir)ui_%(Filename).h')" />
|
||||
<!--Helper for dealing with tlogs-->
|
||||
<!--https://learn.microsoft.com/en-us/visualstudio/msbuild/getoutofdateitems-task?view=vs-2022-->
|
||||
<GetOutOfDateItems Sources="@(QtUi)"
|
||||
OutputsMetadataName="Outputs"
|
||||
CommandMetadataName="Command"
|
||||
TLogDirectory="$(TLogLocation)"
|
||||
TLogNamePrefix="QtUi">
|
||||
<Output TaskParameter="OutOfDateSources" ItemName="OutOfDateQtUi"/>
|
||||
</GetOutOfDateItems>
|
||||
|
||||
<CustomBuild Condition="'@(OutOfDateQtUi)'!=''"
|
||||
Sources="@(OutOfDateQtUi)" />
|
||||
</Target>
|
||||
|
||||
<!--Compile files needed to MOC and output in the build directory-->
|
||||
|
|
|
@ -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;QtTsClean;$(CleanDependsOn)</CleanDependsOn>
|
||||
<CleanDependsOn>QtResourceClean;QtMocClean;QtTsClean;$(CleanDependsOn)</CleanDependsOn>
|
||||
<!--
|
||||
<ComputeLinkInputsTargets>$(ComputeLinkInputsTargets);QtComputeMocOutput;</ComputeLinkInputsTargets>
|
||||
<ComputeLibInputsTargets>$(ComputeLibInputsTargets);QtComputeMocOutput;</ComputeLibInputsTargets>
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
<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" />
|
||||
<ContentType Name="QtResource" DisplayName="Qt Resource Compiler" ItemType="QtResource" />
|
||||
<ContentType Name="QtUi" DisplayName="Qt User Interface Compiler" ItemType = "QtUi"/>
|
||||
<ContentType Name="QtMoc" DisplayName="Qt Meta Object Compiler" ItemType="QtMoc" />
|
||||
<ContentType Name="QtTs" DisplayName="Qt Translation Compiler" ItemType="QtTs" />
|
||||
<FileExtension Name="*.qrc" ContentType="QtResource" />
|
||||
<FileExtension Name="*.ui" ContentType="QtUi" />
|
||||
<FileExtension Name="*.ts" ContentType="QtTs" />
|
||||
|
|
Loading…
Reference in New Issue