Skip to content

Commit

Permalink
Merge pull request #5551 from shuffle2/msbuild-qt-tidy
Browse files Browse the repository at this point in the history
msbuild/qt: remove .qrc and .ui file support
  • Loading branch information
shuffle2 committed Jun 6, 2017
2 parents d51be94 + 0db59c7 commit 59bf761
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 51 deletions.
44 changes: 0 additions & 44 deletions Source/VSProps/QtCompile.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,44 +37,6 @@
</Link>
</ItemDefinitionGroup>

<!--Passes all .qrc files to rcc and puts output in the build directory-->
<ItemGroup>
<ResFiles Include="$(MSBuildProjectDirectory)\**\*.qrc" />
</ItemGroup>
<Target Name="QtResource"
BeforeTargets="ClCompile"
Inputs="@(ResFiles)"
Condition="'@(QtResource)'!=''"
Outputs="@(ResFiles->'$(QtToolOutDir)qrc_%(Filename).h')">
<Message Text="rcc %(ResFiles.Filename)" Importance="High" />
<Error Condition="!$(QtDirValid)" Text="QTDIR not set or non-existent (pull the submodule?)" />
<MakeDir Directories="$(QtToolOutDir)" />
<Exec Command="&quot;$(QtBinDir)rcc.exe&quot; &quot;%(ResFiles.FullPath)&quot; -o &quot;$(QtToolOutDir)qrc_%(ResFiles.Filename).h&quot;" />
</Target>

<Target Name="QtResourceClean">
<Delete Files="@(ResFiles->'$(QtToolOutDir)qrc_%(Filename).h')" />
</Target>

<!--Passes all .ui files to uic and puts output in the build directory-->
<ItemGroup>
<UiFiles Include="$(MSBuildProjectDirectory)\**\*.ui" />
</ItemGroup>
<Target Name="QtUi"
BeforeTargets="ClCompile"
Inputs="@(UiFiles)"
Condition="'@(QtUi)'!=''"
Outputs="@(UiFiles->'$(QtToolOutDir)ui_%(Filename).h')">
<Message Text="uic %(UiFiles.Filename)" Importance="High" />
<Error Condition="!$(QtDirValid)" Text="QTDIR not set or non-existent (pull the submodule?)" />
<MakeDir Directories="$(QtToolOutDir)" />
<Exec Command="&quot;$(QtBinDir)uic.exe&quot; &quot;%(UiFiles.FullPath)&quot; -o &quot;$(QtToolOutDir)ui_%(UiFiles.Filename).h&quot;" />
</Target>

<Target Name="QtUiClean">
<Delete Files="@(UiFiles->'$(QtToolOutDir)ui_%(Filename).h')" />
</Target>

<!--Compile files needed to MOC and output in the build directory-->
<!--TODO find a way to autocreate from ClCompile settings-->
<PropertyGroup>
Expand Down Expand Up @@ -112,12 +74,6 @@
<!--Expose the new targets to VS-->
<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
<AvailableItemName Include="QtResource">
<Targets>QtResource</Targets>
</AvailableItemName>
<AvailableItemName Include="QtUi">
<Targets>QtUi</Targets>
</AvailableItemName>
<AvailableItemName Include="QtMoc">
<Targets>QtMoc</Targets>
</AvailableItemName>
Expand Down
2 changes: 1 addition & 1 deletion Source/VSProps/QtCompile.targets
Original file line number Diff line number Diff line change
@@ -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>QtMocClean;$(CleanDependsOn)</CleanDependsOn>
<!--
<ComputeLinkInputsTargets>$(ComputeLinkInputsTargets);QtComputeMocOutput;</ComputeLinkInputsTargets>
<ComputeLibInputsTargets>$(ComputeLibInputsTargets);QtComputeMocOutput;</ComputeLibInputsTargets>
Expand Down
6 changes: 0 additions & 6 deletions Source/VSProps/QtCompile.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ProjectSchemaDefinitions xmlns="http://schemas.microsoft.com/build/2009/properties">
<ItemType Name="QtResource" DisplayName="Qt Resource File" />
<ItemType Name="QtUi" DisplayName="Qt User Interface File" />
<ItemType Name="QtMoc" DisplayName="Qt Meta Object File" />
<ContentType Name="QtUi" DisplayName="Qt User Interface Compiler" />
<ContentType Name="QtResource" DisplayName="Qt Resource Compiler" />
<ContentType Name="QtMoc" DisplayName="Qt Meta Object Compiler" />
<FileExtension Name="*.qrc" ContentType="QtResource" />
<FileExtension Name="*.ui" ContentType="QtUi" />
</ProjectSchemaDefinitions>

0 comments on commit 59bf761

Please sign in to comment.