2019-12-31 06:17:17 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<PropertyGroup Label="UserMacros">
|
2020-01-11 05:31:16 +00:00
|
|
|
<BinaryOutputDir>$(SolutionDir)bin\$(Platform)\</BinaryOutputDir>
|
2022-07-11 13:03:29 +00:00
|
|
|
<DSQTDIRDefault Condition="'$(Platform)'=='x64'">$(SolutionDir)dep\msvc\qt\6.1.0\msvc2019_64\</DSQTDIRDefault>
|
|
|
|
<DSQTDIRDefault Condition="'$(Platform)'=='ARM64'">$(SolutionDir)dep\msvc\qt\6.3.1\msvc2022_arm64\</DSQTDIRDefault>
|
|
|
|
<DSQTDIR Condition="Exists('$(DSQTDIRDefault)') And ('$(DSQTDIR)'=='' Or !Exists('$(DSQTDIR)'))">$(DSQTDIRDefault)</DSQTDIR>
|
|
|
|
<DSQTDIR Condition="Exists('$(DSQTDIR)') And !HasTrailingSlash('$(DSQTDIR)')">$(DSQTDIR)\</DSQTDIR>
|
|
|
|
<DSQTDIRHost Condition="'$(Platform)'!='ARM64'">$(SolutionDir)dep\msvc\qt\6.1.0\msvc2019_64\</DSQTDIRHost>
|
|
|
|
<DSQTDIRHost Condition="'$(Platform)'=='ARM64'">$(SolutionDir)dep\msvc\qt\6.3.1\msvc2022_64\</DSQTDIRHost>
|
|
|
|
<DSQTDIRValid>false</DSQTDIRValid>
|
|
|
|
<DSQTDIRValid Condition="Exists('$(DSQTDIR)')">true</DSQTDIRValid>
|
|
|
|
<QtIncludeDir>$(DSQTDIR)include\</QtIncludeDir>
|
|
|
|
<QtLibDir>$(DSQTDIR)lib\</QtLibDir>
|
|
|
|
<QtBinDir>$(DSQTDIR)bin\</QtBinDir>
|
|
|
|
<QtHostBinDir>$(DSQTDIRHost)bin\</QtHostBinDir>
|
|
|
|
<QtPluginsDir>$(DSQTDIR)plugins\</QtPluginsDir>
|
|
|
|
<QtTranslationsDir>$(DSQTDIR)translations\</QtTranslationsDir>
|
|
|
|
<QtToolOutDir>$(IntDir)</QtToolOutDir>
|
2019-12-31 06:17:17 +00:00
|
|
|
<QtMocOutPrefix>$(QtToolOutDir)moc_</QtMocOutPrefix>
|
2020-07-27 17:08:41 +00:00
|
|
|
<QtTsOutDir>$(BinaryOutputDir)translations\</QtTsOutDir>
|
2019-12-31 06:17:17 +00:00
|
|
|
<QtDebugSuffix>d</QtDebugSuffix>
|
2022-07-11 13:03:29 +00:00
|
|
|
<QtLibSuffix Condition="$(Configuration.Contains(Debug))">$(QtDebugSuffix)</QtLibSuffix>
|
2019-12-31 06:17:17 +00:00
|
|
|
<QtPluginFolder>QtPlugins</QtPluginFolder>
|
2022-07-11 13:03:29 +00:00
|
|
|
<QtEntryPointLib>$(QtLibDir)Qt6EntryPoint$(QtLibSuffix).lib</QtEntryPointLib>
|
2019-12-31 06:17:17 +00:00
|
|
|
</PropertyGroup>
|
|
|
|
<ItemDefinitionGroup>
|
|
|
|
<ClCompile>
|
2022-07-11 13:03:29 +00:00
|
|
|
<PreprocessorDefinitions Condition="!$(Configuration.Contains(Debug))">QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
2019-12-31 06:17:17 +00:00
|
|
|
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
|
|
<AdditionalIncludeDirectories>$(QtToolOutDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
|
|
<AdditionalIncludeDirectories>$(QtIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
|
|
</ClCompile>
|
|
|
|
<Link>
|
|
|
|
<AdditionalLibraryDirectories>$(QtLibDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
2022-07-11 13:03:29 +00:00
|
|
|
<AdditionalDependencies>Qt6Core$(QtLibSuffix).lib;Qt6Gui$(QtLibSuffix).lib;Qt6Widgets$(QtLibSuffix).lib;Qt6Network$(QtLibSuffix).lib;Qt6Concurrent$(QtLibSuffix).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
2019-12-31 06:17:17 +00:00
|
|
|
</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).cpp')">
|
|
|
|
<Message Text="rcc %(ResFiles.Filename)" Importance="High" />
|
2022-07-11 13:03:29 +00:00
|
|
|
<Error Condition="!$(DSQTDIRValid)" Text="Qt directory non-existent (pull the submodule?)" />
|
2019-12-31 06:17:17 +00:00
|
|
|
<MakeDir Directories="$(QtToolOutDir)" />
|
2021-05-20 04:14:44 +00:00
|
|
|
<Exec Command=""$(QtHostBinDir)rcc.exe" "%(ResFiles.FullPath)" -o "$(QtToolOutDir)qrc_%(ResFiles.Filename).cpp"" />
|
2019-12-31 06:17:17 +00:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="QtResourceClean">
|
|
|
|
<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>
|
|
|
|
<Target Name="QtUi"
|
|
|
|
BeforeTargets="ClCompile"
|
|
|
|
Inputs="@(UiFiles)"
|
|
|
|
Condition="'@(QtUi)'!=''"
|
|
|
|
Outputs="@(UiFiles->'$(QtToolOutDir)ui_%(Filename).h')">
|
|
|
|
<Message Text="uic %(UiFiles.Filename)" Importance="High" />
|
2022-07-11 13:03:29 +00:00
|
|
|
<Error Condition="!$(DSQTDIRValid)" Text="Qt directory non-existent (pull the submodule?)" />
|
2019-12-31 06:17:17 +00:00
|
|
|
<MakeDir Directories="$(QtToolOutDir)" />
|
2021-05-20 04:14:44 +00:00
|
|
|
<Exec Command=""$(QtHostBinDir)uic.exe" "%(UiFiles.FullPath)" -o "$(QtToolOutDir)ui_%(UiFiles.Filename).h"" />
|
2019-12-31 06:17:17 +00:00
|
|
|
</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>
|
|
|
|
<MocDefines></MocDefines>
|
2022-07-11 13:03:29 +00:00
|
|
|
<MocDefines Condition="!$(Configuration.Contains(Debug))">-DQT_NO_DEBUG -DNDEBUG $(MocDefines)</MocDefines>
|
|
|
|
<MocIncludes>-I"$(QtIncludeDir)." -I"$(SolutionDir)pcsx2" "-I$(SolutionDir)." -I.</MocIncludes>
|
2019-12-31 06:17:17 +00:00
|
|
|
</PropertyGroup>
|
|
|
|
<Target Name="QtMoc"
|
|
|
|
BeforeTargets="ClCompile"
|
|
|
|
Condition="'@(QtMoc)'!=''"
|
|
|
|
Inputs="%(QtMoc.Identity);%(QtMoc.AdditionalDependencies);$(MSBuildProjectFile)"
|
2022-07-11 13:03:29 +00:00
|
|
|
Outputs="$(QtToolOutDir)%(QtMoc.RelativeDir)moc_%(QtMoc.Filename).cpp">
|
|
|
|
<Message Text="moc %(QtMoc.Filename) $(QtToolOutDir)%(QtMoc.RelativeDir)moc_%(QtMoc.Filename).cpp" Importance="High" />
|
|
|
|
<Error Condition="!$(DSQTDIRValid)" Text="Qt directory non-existent (pull the submodule?)" />
|
2019-12-31 06:17:17 +00:00
|
|
|
<MakeDir Directories="$(QtToolOutDir)" />
|
2022-07-11 13:03:29 +00:00
|
|
|
<Exec Command=""$(QtHostBinDir)moc.exe" "%(QtMoc.FullPath)" -o "$(QtToolOutDir)%(QtMoc.RelativeDir)moc_%(QtMoc.Filename).cpp" -f%(QtMoc.Filename)%(QtMoc.Extension) $(MocDefines) $(MocIncludes)" />
|
2019-12-31 06:17:17 +00:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<MocOutputs Include="$(QtToolOutDir)moc_*.cpp" />
|
|
|
|
</ItemGroup>
|
|
|
|
<Target Name="QtMocClean">
|
|
|
|
<Delete Files="@(MocOutputs)" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<!--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>
|
2020-07-27 17:08:41 +00:00
|
|
|
<AvailableItemName Include="QtTs">
|
|
|
|
<Targets>QtTs</Targets>
|
|
|
|
</AvailableItemName>
|
2019-12-31 06:17:17 +00:00
|
|
|
</ItemGroup>
|
2020-01-11 05:31:16 +00:00
|
|
|
|
|
|
|
<!--Copy the needed dlls-->
|
|
|
|
<ItemGroup>
|
2022-07-11 13:03:29 +00:00
|
|
|
<QtLibNames Include="Qt6Core$(QtLibSuffix);Qt6Gui$(QtLibSuffix);Qt6Widgets$(QtLibSuffix);Qt6Network$(QtLibSuffix);Qt6Svg$(QtLibSuffix);Qt6Concurrent$(QtLibSuffix)" />
|
2020-01-11 05:31:16 +00:00
|
|
|
<QtDlls Include="@(QtLibNames -> '$(QtBinDir)%(Identity).dll')" />
|
|
|
|
<!--Filter plugins to copy based on the observation that all debug versions end in "d"-->
|
|
|
|
<QtAllPlugins Include="$(QtPluginsDir)**\*$(QtLibSuffix).dll" />
|
2022-07-11 13:03:29 +00:00
|
|
|
<QtPlugins Condition="$(Configuration.Contains(Debug))" Include="@(QtAllPlugins)" />
|
|
|
|
<QtPlugins Condition="!$(Configuration.Contains(Debug))" Exclude="$(QtPluginsDir)**\*$(QtDebugSuffix).dll" Include="@(QtAllPlugins)" />
|
2020-01-11 05:31:16 +00:00
|
|
|
<QtPluginsDest Include="@(QtPlugins -> '$(BinaryOutputDir)$(QtPluginFolder)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
2022-07-11 13:03:29 +00:00
|
|
|
<!--Our normal *d filter fails for the TLS DLLs, because backend ends in d. -->
|
|
|
|
<!--<QtTLSDlls Include="$(QtPluginsDir)tls\qcertonlybackend$(QtLibSuffix).dll;$(QtPluginsDir)tls\qschannelbackend$(QtLibSuffix).dll" />-->
|
|
|
|
<QtTLSDllsDest Include="@(QtTLSDlls -> '$(BinaryOutputDir)$(QtPluginFolder)\tls\%(Filename)%(Extension)')" />
|
2020-01-11 05:31:16 +00:00
|
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup>
|
|
|
|
<QtConfFile>$(BinaryOutputDir)qt.conf</QtConfFile>
|
|
|
|
</PropertyGroup>
|
|
|
|
<Target Name="QtCopyBinaries"
|
|
|
|
AfterTargets="Build"
|
2022-07-11 13:03:29 +00:00
|
|
|
Inputs="@(QtDlls);@(QtPlugins);@(QtTLSDlls)"
|
|
|
|
Outputs="@(QtDlls -> '$(BinaryOutputDir)%(RecursiveDir)%(Filename)%(Extension)');@(QtPluginsDest);@(QtTLSDllsDest)">
|
2020-01-11 05:31:16 +00:00
|
|
|
<Message Text="Copying Qt .dlls" Importance="High" />
|
|
|
|
<Copy
|
|
|
|
SourceFiles="@(QtDlls)"
|
|
|
|
DestinationFolder="$(BinaryOutputDir)"
|
|
|
|
SkipUnchangedFiles="true"
|
|
|
|
/>
|
|
|
|
<Copy
|
|
|
|
SourceFiles="@(QtPlugins)"
|
|
|
|
DestinationFiles="@(QtPluginsDest)"
|
|
|
|
SkipUnchangedFiles="true"
|
|
|
|
/>
|
2022-07-11 13:03:29 +00:00
|
|
|
<Copy
|
|
|
|
SourceFiles="@(QtTLSDlls)"
|
|
|
|
DestinationFiles="@(QtTLSDllsDest)"
|
|
|
|
SkipUnchangedFiles="true"
|
|
|
|
/>
|
2020-01-11 05:31:16 +00:00
|
|
|
</Target>
|
|
|
|
<Target Name="QtCreateConf"
|
|
|
|
BeforeTargets="QtCopyBinaries"
|
|
|
|
Condition="!Exists('$(QtConfFile)')">
|
|
|
|
<!--
|
|
|
|
Create a file which tells Qt where to look for "plugins".
|
|
|
|
Otherwise Qt only looks in ./<subtype>/type.dll instead of ./$(QtPluginFolder)/<subtype>/type.dll, which is messy
|
|
|
|
-->
|
|
|
|
<WriteLinesToFile
|
|
|
|
File="$(QtConfFile)"
|
|
|
|
Lines="[Paths];Plugins = ./$(QtPluginFolder)"
|
|
|
|
Overwrite="true"
|
|
|
|
/>
|
|
|
|
</Target>
|
2021-08-17 03:39:06 +00:00
|
|
|
|
|
|
|
<!--Copies base translation files-->
|
|
|
|
<ItemGroup>
|
|
|
|
<BaseTsFiles Include="$(QtTranslationsDir)\*.qm" />
|
|
|
|
</ItemGroup>
|
|
|
|
<Target Name="QtCopyBaseTranslations"
|
|
|
|
AfterTargets="Build"
|
|
|
|
Inputs="@(BaseTsFiles)"
|
|
|
|
Outputs="@(BaseTsFiles -> '$(QtTsOutDir)%(RecursiveDir)%(Filename)%(Extension)')">
|
|
|
|
<Message Text="Copying base translation files" Importance="High" />
|
|
|
|
<Copy
|
|
|
|
SourceFiles="@(BaseTsFiles)"
|
|
|
|
DestinationFolder="$(QtTsOutDir)"
|
|
|
|
SkipUnchangedFiles="true"
|
|
|
|
/>
|
|
|
|
</Target>
|
2020-07-27 17:08:41 +00:00
|
|
|
|
|
|
|
<!--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" />
|
2022-07-11 13:03:29 +00:00
|
|
|
<Error Condition="!$(DSQTDIRValid)" Text="Qt directory non-existent (pull the submodule?)" />
|
2020-07-27 17:08:41 +00:00
|
|
|
<MakeDir Directories="$(QtTsOutDir)" />
|
2021-05-20 04:14:44 +00:00
|
|
|
<Exec Command=""$(QtHostBinDir)lrelease.exe" "%(TsFiles.FullPath)" -qm "$(QtTsOutDir)%(TsFiles.Filename).qm"" />
|
2020-07-27 17:08:41 +00:00
|
|
|
</Target>
|
|
|
|
<ItemGroup>
|
|
|
|
<TsOutputs Include="$(QtTsOutDir)*.qm" />
|
|
|
|
</ItemGroup>
|
|
|
|
<Target Name="QtTsClean">
|
|
|
|
<Delete Files="@(TsOutputs)" />
|
|
|
|
</Target>
|
2019-12-31 06:17:17 +00:00
|
|
|
</Project>
|