| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<Project> |
| 3 |
<PropertyGroup Label="UserMacros"> |
| 4 |
<ExternalsQtDir>$(ExternalsDir)Qt\Qt6.5.1\</ExternalsQtDir> |
| 5 |
<QtTargetDirDefault>$(ExternalsQtDir)$(Platform)\</QtTargetDirDefault> |
| 6 |
<QTDIR Condition="Exists('$(QtTargetDirDefault)') And ('$(QTDIR)'=='' Or !Exists('$(QTDIR)'))">$(QtTargetDirDefault)</QTDIR> |
| 7 |
<QTDIR Condition="Exists('$(QTDIR)') And !HasTrailingSlash('$(QTDIR)')">$(QTDIR)\</QTDIR> |
| 8 |
<QtDirValid>false</QtDirValid> |
| 9 |
<QtDirValid Condition="Exists('$(QTDIR)')">true</QtDirValid> |
| 10 |
<QtIncludeDir>$(QTDIR)include\</QtIncludeDir> |
| 11 |
<QtLibDir>$(QTDIR)lib\</QtLibDir> |
| 12 |
<QtBinDir>$(QTDIR)bin\</QtBinDir> |
| 13 |
<QtPluginsDir>$(QTDIR)plugins\</QtPluginsDir> |
| 14 |
<QtToolOutDir>$(IntDir)</QtToolOutDir> |
| 15 |
<QtDebugSuffix>d</QtDebugSuffix> |
| 16 |
<QtHostToolsDir>$(ExternalsQtDir)x64\</QtHostToolsDir> |
| 17 |
<QtLibSuffix Condition="'$(Configuration)'=='Debug'">$(QtDebugSuffix)</QtLibSuffix> |
| 18 |
<QtPluginFolder>QtPlugins</QtPluginFolder> |
| 19 |
</PropertyGroup> |
| 20 |
<ItemDefinitionGroup> |
| 21 |
<ClCompile> |
| 22 |
<PreprocessorDefinitions Condition="'$(Configuration)'=='Release'">QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 23 |
<PreprocessorDefinitions>QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 24 |
<PreprocessorDefinitions>QT_USE_QSTRINGBUILDER;QT_NO_CAST_FROM_ASCII;QT_NO_CAST_TO_ASCII;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 25 |
<AdditionalIncludeDirectories>$(QtIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| 26 |
<AdditionalIncludeDirectories>$(QtIncludeDir)QtCore;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| 27 |
<AdditionalIncludeDirectories>$(QtIncludeDir)QtGui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| 28 |
<AdditionalIncludeDirectories>$(QtIncludeDir)QtWidgets;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| 29 |
<!-- |
| 30 |
As of Qt6.3, Qt needs user code deriving from certain Qt types to have RTTI (AS WELL AS MOC, UGH). |
| 31 |
Do NOT enable in dolphin outside of Qt-dependant code. |
| 32 |
--> |
| 33 |
<RuntimeTypeInfo>true</RuntimeTypeInfo> |
| 34 |
</ClCompile> |
| 35 |
<Link> |
| 36 |
<AdditionalLibraryDirectories>$(QtLibDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
| 37 |
<AdditionalDependencies>Qt6Core$(QtLibSuffix).lib;Qt6Gui$(QtLibSuffix).lib;Qt6Widgets$(QtLibSuffix).lib;%(AdditionalDependencies)</AdditionalDependencies> |
| 38 |
<SubSystem>Windows</SubSystem> |
| 39 |
<!-- |
| 40 |
<AdditionalOptions>"/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\" %(AdditionalOptions)</AdditionalOptions> |
| 41 |
--> |
| 42 |
</Link> |
| 43 |
</ItemDefinitionGroup> |
| 44 |
|
| 45 |
<!-- |
| 46 |
Use the moc implementation provided by (somewhat out-of-date version of) "Qt VS Tools" |
| 47 |
see: https://code.qt.io/cgit/qt-labs/vstools.git/tree/QtMSBuild |
| 48 |
This provides a wrapper around moc which deals with parallel dispatch to moc, |
| 49 |
as well as creating ClCompile inputs from the moc outputs. |
| 50 |
Note that we currently pass the same ClCompile.PreprocessorDefinitions to moc, |
| 51 |
but not the include paths, as passing include paths drastically slows down |
| 52 |
moc, and it doesn't appear to actually need them anyway. |
| 53 |
--> |
| 54 |
<Import Project="qt_globals.targets"/> |
| 55 |
<Import Project="qt_tasks.targets"/> |
| 56 |
<ItemDefinitionGroup> |
| 57 |
<!--From qtmoc.props--> |
| 58 |
<QtMoc> |
| 59 |
<ExecutionDescription>moc %(Identity)</ExecutionDescription> |
| 60 |
<QTDIR>$(QtHostToolsDir)</QTDIR> |
| 61 |
<InputFile>%(FullPath)</InputFile> |
| 62 |
<!-- |
| 63 |
moc task does not properly detect outputs are outdated if Qt version changes |
| 64 |
(possibly causing Q_MOC_OUTPUT_REVISION to change). This *might* be because we |
| 65 |
don't give moc the include paths, so it doesn't notice the version change. |
| 66 |
In any case, we can workaround it by manually changing output path when needed |
| 67 |
to avoid conflicts. (the numeric postfix is the value of Q_MOC_OUTPUT_REVISION) |
| 68 |
--> |
| 69 |
<OutputFile>$(QtToolOutDir)moc_68\moc_%(Filename).cpp</OutputFile> |
| 70 |
<QtMocDir>$(QtToolOutDir)moc_68\</QtMocDir> |
| 71 |
<QtMocFileName>moc_%(Filename).cpp</QtMocFileName> |
| 72 |
<DynamicSource>output</DynamicSource> |
| 73 |
<ParallelProcess>true</ParallelProcess> |
| 74 |
<CommandLineTemplate>[AllOptions] [AdditionalOptions]</CommandLineTemplate> |
| 75 |
<Outputs>%(OutputFile)</Outputs> |
| 76 |
<OverrideClCompile>false</OverrideClCompile> |
| 77 |
</QtMoc> |
| 78 |
</ItemDefinitionGroup> |
| 79 |
<Import Project="qtmoc.targets" /> |
| 80 |
<Target Name="QtCheckQtDir" BeforeTargets="QtMocInit" Condition="!$(QtDirValid)"> |
| 81 |
<Error Text="QTDIR not set or non-existent (pull the submodule?)" /> |
| 82 |
</Target> |
| 83 |
|
| 84 |
<!--Similar story with rcc--> |
| 85 |
<ItemDefinitionGroup> |
| 86 |
<!--From qtrcc.props--> |
| 87 |
<QtRcc> |
| 88 |
<ExecutionDescription>rcc %(Identity)</ExecutionDescription> |
| 89 |
<QTDIR>$(QtHostToolsDir)</QTDIR> |
| 90 |
<InputFile>%(FullPath)</InputFile> |
| 91 |
<OutputFile>$(QtToolOutDir)rcc\qrc_%(Filename).cpp</OutputFile> |
| 92 |
<QtRccDir>$(QtToolOutDir)rcc\</QtRccDir> |
| 93 |
<QtRccFileName>qrc_%(Filename).cpp</QtRccFileName> |
| 94 |
<InitFuncName>%(Filename)</InitFuncName> |
| 95 |
<Compression>default</Compression> |
| 96 |
<TwoPass>false</TwoPass> |
| 97 |
<DynamicSource>output</DynamicSource> |
| 98 |
<ParallelProcess>true</ParallelProcess> |
| 99 |
<CommandLineTemplate>[AllOptions] [AdditionalOptions]</CommandLineTemplate> |
| 100 |
<Outputs>%(OutputFile)</Outputs> |
| 101 |
</QtRcc> |
| 102 |
</ItemDefinitionGroup> |
| 103 |
<Import Project="qtrcc.targets" /> |
| 104 |
|
| 105 |
<!--Expose the new targets to VS--> |
| 106 |
<ItemGroup> |
| 107 |
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" /> |
| 108 |
</ItemGroup> |
| 109 |
|
| 110 |
<!--Copy the needed dlls--> |
| 111 |
<ItemGroup> |
| 112 |
<QtDllNames_ Include="Qt6Core;Qt6Gui;Qt6Widgets;Qt6Svg" /> |
| 113 |
<QtDllNames Include="@(QtDllNames_ -> '%(Identity)$(QtLibSuffix).dll')" /> |
| 114 |
<QtDllsSrc Include="@(QtDllNames -> '$(QtBinDir)%(Identity)')" /> |
| 115 |
<QtDllsDst Include="@(QtDllNames -> '$(BinaryOutputDir)%(Identity)')" /> |
| 116 |
<QtPluginNames_ Include="iconengines\qsvgicon;imageformats\qsvg;platforms\qdirect2d;platforms\qwindows;styles\qwindowsvistastyle"/> |
| 117 |
<QtPluginNames Include="@(QtPluginNames_ -> '%(Identity)$(QtLibSuffix).dll')" /> |
| 118 |
<QtPluginsSrc Include="@(QtPluginNames -> '$(QtPluginsDir)%(Identity)')" /> |
| 119 |
<QtPluginsDst Include="@(QtPluginNames -> '$(BinaryOutputDir)$(QtPluginFolder)\%(Identity)')" /> |
| 120 |
</ItemGroup> |
| 121 |
<PropertyGroup> |
| 122 |
<QtConfFile>$(BinaryOutputDir)qt.conf</QtConfFile> |
| 123 |
</PropertyGroup> |
| 124 |
<Target Name="QtCopyBinaries" |
| 125 |
AfterTargets="Build" |
| 126 |
Inputs="@(QtDllsSrc);@(QtPluginsSrc)" |
| 127 |
Outputs="@(QtDllsDst);@(QtPluginsDst)"> |
| 128 |
<Copy |
| 129 |
SourceFiles="@(QtDllsSrc)" |
| 130 |
DestinationFiles="@(QtDllsDst)" |
| 131 |
SkipUnchangedFiles="true" |
| 132 |
/> |
| 133 |
<Copy |
| 134 |
SourceFiles="@(QtPluginsSrc)" |
| 135 |
DestinationFiles="@(QtPluginsDst)" |
| 136 |
SkipUnchangedFiles="true" |
| 137 |
/> |
| 138 |
</Target> |
| 139 |
<Target Name="QtCreateConf" |
| 140 |
BeforeTargets="QtCopyBinaries" |
| 141 |
Condition="!Exists('$(QtConfFile)')"> |
| 142 |
<!-- |
| 143 |
Create a file which tells Qt where to look for "plugins". |
| 144 |
Otherwise Qt only looks in ./<subtype>/type.dll instead of ./$(QtPluginFolder)/<subtype>/type.dll, which is messy |
| 145 |
--> |
| 146 |
<WriteLinesToFile |
| 147 |
File="$(QtConfFile)" |
| 148 |
Lines="[Paths];Plugins = ./$(QtPluginFolder)" |
| 149 |
Overwrite="true" |
| 150 |
/> |
| 151 |
</Target> |
| 152 |
</Project> |