diff options
author | Miguel Costa <miguel.costa@qt.io> | 2019-07-08 16:42:53 +0200 |
---|---|---|
committer | Miguel Costa <miguel.costa@qt.io> | 2019-08-05 09:15:54 +0000 |
commit | 3e7709dcf5927f5674cccc253ecefae3ab758166 (patch) | |
tree | 1853ab03ada2db130e7774d88c4c36dfb8021730 | |
parent | d3df725584b6107fc54d9f9db6201ece457f69fc (diff) |
Use V3 format settings with Qt tools
This change updates the existing property pages for Qt tools with the
features introduced by the V3 project format.
Task-number: QTVSADDINBUG-575
Change-Id: I37867cc616677fe18b99649b0bff9371c2cf430d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r-- | src/qtmsbuild/moc/qtmoc.props | 17 | ||||
-rw-r--r-- | src/qtmsbuild/moc/qtmoc.targets | 28 | ||||
-rw-r--r-- | src/qtmsbuild/moc/qtmoc.xml | 10 | ||||
-rw-r--r-- | src/qtmsbuild/moc/qtmoc_settings.xml | 68 | ||||
-rw-r--r-- | src/qtmsbuild/qml/qtqml.targets | 15 | ||||
-rw-r--r-- | src/qtmsbuild/rcc/qtrcc.props | 17 | ||||
-rw-r--r-- | src/qtmsbuild/rcc/qtrcc.targets | 29 | ||||
-rw-r--r-- | src/qtmsbuild/rcc/qtrcc.xml | 10 | ||||
-rw-r--r-- | src/qtmsbuild/rcc/qtrcc_settings.xml | 67 | ||||
-rw-r--r-- | src/qtmsbuild/repc/qtrepc.props | 3 | ||||
-rw-r--r-- | src/qtmsbuild/repc/qtrepc.targets | 3 | ||||
-rw-r--r-- | src/qtmsbuild/uic/qtuic.props | 17 | ||||
-rw-r--r-- | src/qtmsbuild/uic/qtuic.targets | 34 | ||||
-rw-r--r-- | src/qtmsbuild/uic/qtuic.xml | 10 | ||||
-rw-r--r-- | src/qtmsbuild/uic/qtuic_settings.xml | 67 | ||||
-rw-r--r-- | src/qtvstools/QtVsTools.csproj | 18 |
16 files changed, 395 insertions, 18 deletions
diff --git a/src/qtmsbuild/moc/qtmoc.props b/src/qtmsbuild/moc/qtmoc.props index 6f7c9b8e..9d1be76b 100644 --- a/src/qtmsbuild/moc/qtmoc.props +++ b/src/qtmsbuild/moc/qtmoc.props @@ -48,9 +48,22 @@ <ItemDefinitionGroup> <QtMoc> <ExecutionDescription>moc %(Identity)</ExecutionDescription> - <QTDIR>$(QTDIR)</QTDIR> + + <QTDIR Condition="'$(QtVsProjectSettings)' != 'true'" + >$(QTDIR)</QTDIR> + <QTDIR Condition="'$(QtVsProjectSettings)' == 'true'" + >$(QtInstallDir)</QTDIR> + <InputFile>%(FullPath)</InputFile> - <OutputFile>$(ProjectDir)GeneratedFiles\$(Configuration)\moc_%(Filename).cpp</OutputFile> + + <OutputFile Condition="'$(QtVsProjectSettings)' != 'true'" + >$(ProjectDir)GeneratedFiles\$(Configuration)\moc_%(Filename).cpp</OutputFile> + + <QtMocDir Condition="'$(QtVsProjectSettings)' == 'true'" + >$(IntDir)\moc\%(RelativeDir)</QtMocDir> + <QtMocFileName Condition="'$(QtVsProjectSettings)' == 'true'" + >moc_%(Filename).cpp</QtMocFileName> + <DynamicSource>output</DynamicSource> <ParallelProcess>true</ParallelProcess> <CommandLineTemplate>[AllOptions] [AdditionalOptions]</CommandLineTemplate> diff --git a/src/qtmsbuild/moc/qtmoc.targets b/src/qtmsbuild/moc/qtmoc.targets index 5be67d17..acbdc89a 100644 --- a/src/qtmsbuild/moc/qtmoc.targets +++ b/src/qtmsbuild/moc/qtmoc.targets @@ -58,6 +58,9 @@ <ItemGroup> <PropertyPageSchema Include="$(MSBuildThisFileDirectory)qtmoc.xml" /> + <PropertyPageSchema + Condition="'$(QtVsProjectSettings)' == 'true'" + Include="$(MSBuildThisFileDirectory)qtmoc_settings.xml" /> <AvailableItemName Include="QtMoc"> <Targets>Qt;_ClCompile</Targets> </AvailableItemName> @@ -65,11 +68,29 @@ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////// + /// TARGET QtMocInit + ///////////////////////////////////////////////////////////////////////////////////////////////// + // Initialize default metadata + // --> + <Target Name="QtMocInit"> + <!--// Initialize %(OutputFile) --> + <ItemGroup Condition="'$(QtVsProjectSettings)' == 'true'"> + <QtMocAux Include="@(QtMoc)"> + <OutputFile>%(QtMoc.QtMocDir)\%(QtMoc.QtMocFileName)</OutputFile> + </QtMocAux> + <QtMoc Remove="@(QtMoc)"/> + <QtMoc Include="@(QtMocAux)"/> + <QtMocAux Remove="@(QtMocAux)"/> + </ItemGroup> + </Target> + + <!-- + ///////////////////////////////////////////////////////////////////////////////////////////////// /// TARGET QtMocPrepare ///////////////////////////////////////////////////////////////////////////////////////////////// // Prepare to process sources // --> - <Target Name="QtMocPrepare" DependsOnTargets="_SelectedFiles" + <Target Name="QtMocPrepare" DependsOnTargets="_SelectedFiles;QtMocInit" Inputs="%(QtMoc.Identity)" Outputs="@(QtMoc->'####### Don't skip this target #######')"> <Message Importance="High" Condition="'$(QtDebug)' == 'true'" @@ -341,7 +362,10 @@ <ItemGroup Condition="'$(run_parallel)' == 'true' OR '$(run_single)' == 'true'"> <QtWork Include="@(QtMoc)"> <WorkType>moc</WorkType> - <ToolPath>%(QtMoc.QTDIR)\bin\moc.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' == 'true'" + >$(QtToolsPath)\moc.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' != 'true'" + >%(QtMoc.QTDIR)\bin\moc.exe</ToolPath> <Options>$(options)</Options> <Message>%(QtMoc.ExecutionDescription)</Message> <DependenciesChanged>$(dependencies_changed)</DependenciesChanged> diff --git a/src/qtmsbuild/moc/qtmoc.xml b/src/qtmsbuild/moc/qtmoc.xml index 148e2a51..04643059 100644 --- a/src/qtmsbuild/moc/qtmoc.xml +++ b/src/qtmsbuild/moc/qtmoc.xml @@ -77,6 +77,16 @@ DisplayName="Qt Directory" Description="Path to installation of Qt."/> <StringProperty + Name="QtMocDir" + DisplayName="Output Directory" + Description="Specifies the path of the generated moc output directory." + Visible="false"/> + <StringProperty + Name="QtMocFileName" + DisplayName="Output File Name" + Description="Specifies the name of the generated moc output file." + Visible="false"/> + <StringProperty Name="InputFile" HelpUrl="http://doc.qt.io/qt-5/moc.html" DisplayName="Input File" diff --git a/src/qtmsbuild/moc/qtmoc_settings.xml b/src/qtmsbuild/moc/qtmoc_settings.xml new file mode 100644 index 00000000..504a7506 --- /dev/null +++ b/src/qtmsbuild/moc/qtmoc_settings.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt VS Tools. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<ProjectSchemaDefinitions + xmlns="http://schemas.microsoft.com/build/2009/properties" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:sys="clr-namespace:System;assembly=mscorlib"> + <Rule + Name="QtRule30_Moc" + OverrideMode="Extend" + PageTemplate="tool" + DisplayName="Qt Meta-Object Compiler" + Order="9"> + <Rule.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="QtMoc" /> + </Rule.DataSource> + <StringProperty + Name="QTDIR" + DisplayName="Qt Directory" + Description="Path to installation of Qt." + Visible="false"/> + <StringProperty + Name="InputFile" + DisplayName="Input File" + Visible="false"/> + <StringProperty + Name="OutputFile" + DisplayName="Output File" + Visible="false"/> + <StringProperty + Name="QtMocDir" + DisplayName="Output Directory" + Description="Specifies the path of the generated moc output directory."/> + <StringProperty + Name="QtMocFileName" + DisplayName="Output File Name" + Description="Specifies the name of the generated moc output file."/> + </Rule> +</ProjectSchemaDefinitions> diff --git a/src/qtmsbuild/qml/qtqml.targets b/src/qtmsbuild/qml/qtqml.targets index 03f85471..dfb9159d 100644 --- a/src/qtmsbuild/qml/qtqml.targets +++ b/src/qtmsbuild/qml/qtqml.targets @@ -302,7 +302,10 @@ AND '%(QtRccFilter.OtherResources)' != '' AND '%(QtRccFilter.IsSelected)' == 'true'"> <WorkType>qmlcachegen_filter</WorkType> - <ToolPath>%(QtRccFilter.QTDIR)\bin\qmlcachegen.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' == 'true'" + >$(QtToolsPath)\qmlcachegen.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' != 'true'" + >%(QtRccFilter.QTDIR)\bin\qmlcachegen.exe</ToolPath> <Options>$(options)</Options> <OutputFile>$(full_path)</OutputFile> <Message>%(QtRccFilter.QmlCacheFilterMessage)</Message> @@ -444,7 +447,10 @@ Condition="'@(loader_input)' != '' AND $(is_selected.Contains('true'))"> <WorkType>qmlcachengen_loader</WorkType> - <ToolPath>@(loader->'%(QTDIR)')\bin\qmlcachegen.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' == 'true'" + >$(QtToolsPath)\qmlcachegen.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' != 'true'" + >@(loader->'%(QTDIR)')\bin\qmlcachegen.exe</ToolPath> <Options>$(options)</Options> <OutputFile>@(loader->'%(QmlCacheLoaderFile)')</OutputFile> <Message>@(loader->'%(QmlCacheLoaderMessage)')</Message> @@ -570,7 +576,10 @@ Condition="'@(QtQml)' != '' AND '%(QtQml.IsSelected)' == 'true'"> <WorkType>qmlcachegen</WorkType> - <ToolPath>%(QtQml.QTDIR)\bin\qmlcachegen.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' == 'true'" + >$(QtToolsPath)\qmlcachegen.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' != 'true'" + >%(QtQml.QTDIR)\bin\qmlcachegen.exe</ToolPath> <Options>$(options)</Options> <Message>%(QtQml.Message)</Message> <DependenciesChanged>$(dependencies_changed)</DependenciesChanged> diff --git a/src/qtmsbuild/rcc/qtrcc.props b/src/qtmsbuild/rcc/qtrcc.props index 444bada6..f8985955 100644 --- a/src/qtmsbuild/rcc/qtrcc.props +++ b/src/qtmsbuild/rcc/qtrcc.props @@ -48,9 +48,22 @@ <ItemDefinitionGroup> <QtRcc> <ExecutionDescription>rcc %(Identity)</ExecutionDescription> - <QTDIR>$(QTDIR)</QTDIR> + + <QTDIR Condition="'$(QtVsProjectSettings)' != 'true'" + >$(QTDIR)</QTDIR> + <QTDIR Condition="'$(QtVsProjectSettings)' == 'true'" + >$(QtInstallDir)</QTDIR> + <InputFile>%(FullPath)</InputFile> - <OutputFile>$(ProjectDir)GeneratedFiles\$(Configuration)\qrc_%(Filename).cpp</OutputFile> + + <OutputFile Condition="'$(QtVsProjectSettings)' != 'true'" + >$(ProjectDir)GeneratedFiles\$(Configuration)\qrc_%(Filename).cpp</OutputFile> + + <QtRccDir Condition="'$(QtVsProjectSettings)' == 'true'" + >$(IntDir)\rcc\%(RelativeDir)</QtRccDir> + <QtRccFileName Condition="'$(QtVsProjectSettings)' == 'true'" + >qrc_%(Filename).cpp</QtRccFileName> + <InitFuncName>%(Filename)</InitFuncName> <Compression>default</Compression> <DynamicSource>output</DynamicSource> diff --git a/src/qtmsbuild/rcc/qtrcc.targets b/src/qtmsbuild/rcc/qtrcc.targets index 58393605..8082bf80 100644 --- a/src/qtmsbuild/rcc/qtrcc.targets +++ b/src/qtmsbuild/rcc/qtrcc.targets @@ -58,6 +58,9 @@ <ItemGroup> <PropertyPageSchema Include="$(MSBuildThisFileDirectory)qtrcc.xml" /> + <PropertyPageSchema + Condition="'$(QtVsProjectSettings)' == 'true'" + Include="$(MSBuildThisFileDirectory)qtrcc_settings.xml" /> <AvailableItemName Include="QtRcc"> <Targets>Qt;_ClCompile</Targets> </AvailableItemName> @@ -65,16 +68,35 @@ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////// + /// TARGET QtRccInit + ///////////////////////////////////////////////////////////////////////////////////////////////// + // Initialize default metadata + // --> + <Target Name="QtRccInit"> + <!--// Initialize %(OutputFile) --> + <ItemGroup Condition="'$(QtVsProjectSettings)' == 'true'"> + <QtRccAux Include="@(QtRcc)"> + <OutputFile>%(QtRcc.QtRccDir)\%(QtRcc.QtRccFileName)</OutputFile> + </QtRccAux> + <QtRcc Remove="@(QtRcc)"/> + <QtRcc Include="@(QtRccAux)"/> + <QtRccAux Remove="@(QtRccAux)"/> + </ItemGroup> + </Target> + + <!-- + ///////////////////////////////////////////////////////////////////////////////////////////////// /// TARGET QtRccSetDependencies ///////////////////////////////////////////////////////////////////////////////////////////////// // Add resource files as dependencies of the QRC file // --> - <Target Name="QtRccSetDependencies" DependsOnTargets="_SelectedFiles" + <Target Name="QtRccSetDependencies" DependsOnTargets="_SelectedFiles;QtRccInit" Inputs="%(QtRcc.Identity)" Outputs="@(QtRcc->'####### Don't skip this target #######')"> <!--// Parse QRC --> <PropertyGroup> - <QtRccExeQuoted>"%(QtRcc.QTDIR)\bin\rcc.exe"</QtRccExeQuoted> + <QtRccExeQuoted Condition="'$(QtVsProjectSettings)' == 'true'">"$(QtToolsPath)\rcc.exe"</QtRccExeQuoted> + <QtRccExeQuoted Condition="'$(QtVsProjectSettings)' != 'true'">"%(QtRcc.QTDIR)\bin\rcc.exe"</QtRccExeQuoted> <QtRccQuoted>"%(QtRcc.Identity)"</QtRccQuoted> <RccListQuoted>"$(IntDir)rcc_list.txt"</RccListQuoted> </PropertyGroup> @@ -351,7 +373,8 @@ <ItemGroup Condition="'$(run_parallel)' == 'true' OR '$(run_single)' == 'true'"> <QtWork Include="@(QtRcc)"> <WorkType>rcc</WorkType> - <ToolPath>%(QtRcc.QTDIR)\bin\rcc.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' == 'true'">$(QtToolsPath)\rcc.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' != 'true'">%(QtRcc.QTDIR)\bin\rcc.exe</ToolPath> <Options>$(options)</Options> <Message>%(QtRcc.ExecutionDescription)</Message> <DependenciesChanged>$(dependencies_changed)</DependenciesChanged> diff --git a/src/qtmsbuild/rcc/qtrcc.xml b/src/qtmsbuild/rcc/qtrcc.xml index 3738a201..a984f0bd 100644 --- a/src/qtmsbuild/rcc/qtrcc.xml +++ b/src/qtmsbuild/rcc/qtrcc.xml @@ -77,6 +77,16 @@ DisplayName="Qt Directory" Description="Path to installation of Qt."/> <StringProperty + Name="QtRccDir" + DisplayName="Output Directory" + Description="Specifies the path of the generated rcc output directory." + Visible="false"/> + <StringProperty + Name="QtRccFileName" + DisplayName="Output File Name" + Description="Specifies the name of the generated rcc output file." + Visible="false"/> + <StringProperty Name="InputFile" HelpUrl="http://doc.qt.io/qt-5/rcc.html" DisplayName="Input File" diff --git a/src/qtmsbuild/rcc/qtrcc_settings.xml b/src/qtmsbuild/rcc/qtrcc_settings.xml new file mode 100644 index 00000000..ce904244 --- /dev/null +++ b/src/qtmsbuild/rcc/qtrcc_settings.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt VS Tools. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<ProjectSchemaDefinitions + xmlns="http://schemas.microsoft.com/build/2009/properties" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:sys="clr-namespace:System;assembly=mscorlib"> + <Rule + Name="QtRule40_Rcc" + OverrideMode="Extend" + PageTemplate="tool" + DisplayName="Qt Resource Compiler" + Order="9"> + <Rule.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="QtRcc" /> + </Rule.DataSource> + <StringProperty + Name="QTDIR" + DisplayName="Qt Directory" + Visible="false"/> + <StringProperty + Name="InputFile" + DisplayName="Input File" + Visible="false"/> + <StringProperty + Name="OutputFile" + DisplayName="Output File" + Visible="false"/> + <StringProperty + Name="QtRccDir" + DisplayName="Output Directory" + Description="Specifies the path of the generated rcc output directory."/> + <StringProperty + Name="QtRccFileName" + DisplayName="Output File Name" + Description="Specifies the name of the generated rcc output file."/> + </Rule> +</ProjectSchemaDefinitions> diff --git a/src/qtmsbuild/repc/qtrepc.props b/src/qtmsbuild/repc/qtrepc.props index ebf1dee8..0d81485c 100644 --- a/src/qtmsbuild/repc/qtrepc.props +++ b/src/qtmsbuild/repc/qtrepc.props @@ -49,7 +49,8 @@ <ItemDefinitionGroup> <QtRepc> <ExecutionDescription>repc %(Identity)</ExecutionDescription> - <QTDIR>$(QTDIR)</QTDIR> + <QTDIR Condition="'$(QtVsProjectSettings)' == 'true'">$(QtInstallDir)</QTDIR> + <QTDIR Condition="'$(QtVsProjectSettings)' != 'true'">$(QTDIR)</QTDIR> <InputFile>%(FullPath)</InputFile> <OutputFileType>replica</OutputFileType> <OutputFile><![CDATA[$(IntDir)\repc\rep_%(Filename)_%<OutputFileType>.h]]></OutputFile> diff --git a/src/qtmsbuild/repc/qtrepc.targets b/src/qtmsbuild/repc/qtrepc.targets index c8bd0bf4..94418476 100644 --- a/src/qtmsbuild/repc/qtrepc.targets +++ b/src/qtmsbuild/repc/qtrepc.targets @@ -267,7 +267,8 @@ <ItemGroup Condition="'$(run_parallel)' == 'true' OR '$(run_single)' == 'true'"> <QtWork Include="@(QtRepc)"> <WorkType>repc</WorkType> - <ToolPath>%(QtRepc.QTDIR)\bin\repc.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' == 'true'">$(QtToolsPath)\repc.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' != 'true'">%(QtRepc.QTDIR)\bin\repc.exe</ToolPath> <Options>$(options)</Options> <Message>%(QtRepc.ExecutionDescription)</Message> <DependenciesChanged>$(dependencies_changed)</DependenciesChanged> diff --git a/src/qtmsbuild/uic/qtuic.props b/src/qtmsbuild/uic/qtuic.props index 3f7ce3b2..eb9ee63a 100644 --- a/src/qtmsbuild/uic/qtuic.props +++ b/src/qtmsbuild/uic/qtuic.props @@ -49,9 +49,22 @@ <ItemDefinitionGroup> <QtUic> <ExecutionDescription>uic %(Identity)</ExecutionDescription> - <QTDIR>$(QTDIR)</QTDIR> + + <QTDIR Condition="'$(QtVsProjectSettings)' != 'true'" + >$(QTDIR)</QTDIR> + <QTDIR Condition="'$(QtVsProjectSettings)' == 'true'" + >$(QtInstallDir)</QTDIR> + <InputFile>%(FullPath)</InputFile> - <OutputFile>$(ProjectDir)GeneratedFiles\$(Configuration)\ui_%(Filename).h</OutputFile> + + <OutputFile Condition="'$(QtVsProjectSettings)' != 'true'" + >$(ProjectDir)GeneratedFiles\$(Configuration)\ui_%(Filename).h</OutputFile> + + <QtUicDir Condition="'$(QtVsProjectSettings)' == 'true'" + >$(IntDir)\uic\%(RelativeDir)</QtUicDir> + <QtUicFileName Condition="'$(QtVsProjectSettings)' == 'true'" + >ui_%(Filename).h</QtUicFileName> + <ParallelProcess>true</ParallelProcess> <CommandLineTemplate>[AllOptions] [AdditionalOptions]</CommandLineTemplate> <Outputs>%(OutputFile)</Outputs> diff --git a/src/qtmsbuild/uic/qtuic.targets b/src/qtmsbuild/uic/qtuic.targets index e6a4cdc0..4c117052 100644 --- a/src/qtmsbuild/uic/qtuic.targets +++ b/src/qtmsbuild/uic/qtuic.targets @@ -58,6 +58,9 @@ <ItemGroup> <PropertyPageSchema Include="$(MSBuildThisFileDirectory)qtuic.xml" /> + <PropertyPageSchema + Condition="'$(QtVsProjectSettings)' == 'true'" + Include="$(MSBuildThisFileDirectory)qtuic_settings.xml" /> <AvailableItemName Include="QtUic"> <Targets>Qt</Targets> </AvailableItemName> @@ -65,11 +68,29 @@ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////// + /// TARGET QtUicInit + ///////////////////////////////////////////////////////////////////////////////////////////////// + // Initialize default metadata + // --> + <Target Name="QtUicInit"> + <!--// Initialize %(OutputFile) --> + <ItemGroup Condition="'$(QtVsProjectSettings)' == 'true'"> + <QtUicAux Include="@(QtUic)"> + <OutputFile>%(QtUic.QtUicDir)\%(QtUic.QtUicFileName)</OutputFile> + </QtUicAux> + <QtUic Remove="@(QtUic)"/> + <QtUic Include="@(QtUicAux)"/> + <QtUicAux Remove="@(QtUicAux)"/> + </ItemGroup> + </Target> + + <!-- + ///////////////////////////////////////////////////////////////////////////////////////////////// /// TARGET QtUicPrepare ///////////////////////////////////////////////////////////////////////////////////////////////// // Prepare to process sources // --> - <Target Name="QtUicPrepare" DependsOnTargets="_SelectedFiles" + <Target Name="QtUicPrepare" DependsOnTargets="_SelectedFiles;QtUicInit" Inputs="%(QtUic.Identity)" Outputs="@(QtUic->'####### Don't skip this target #######')"> <Message Importance="High" Condition="'$(QtDebug)' == 'true'" @@ -257,7 +278,8 @@ <ItemGroup Condition="'$(run_parallel)' == 'true' OR '$(run_single)' == 'true'"> <QtWork Include="@(QtUic)"> <WorkType>uic</WorkType> - <ToolPath>%(QtUic.QTDIR)\bin\uic.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' == 'true'">$(QtToolsPath)\uic.exe</ToolPath> + <ToolPath Condition="'$(QtVsProjectSettings)' != 'true'">%(QtUic.QTDIR)\bin\uic.exe</ToolPath> <Options>$(options)</Options> <Message>%(QtUic.ExecutionDescription)</Message> <DependenciesChanged>$(dependencies_changed)</DependenciesChanged> @@ -269,6 +291,14 @@ <!-- /////////////////////////////////////////////////////////////////////////////////////////////// + // Add uic output dir to C++ include path + // --> + <ItemGroup> + <QtIncludePath Include="$([System.IO.Path]::GetDirectoryName('%(QtUic.OutputFile)'))"/> + </ItemGroup> + + <!-- + /////////////////////////////////////////////////////////////////////////////////////////////// // Clean-up // --> <PropertyGroup> diff --git a/src/qtmsbuild/uic/qtuic.xml b/src/qtmsbuild/uic/qtuic.xml index 7757d3a4..bb95c8f1 100644 --- a/src/qtmsbuild/uic/qtuic.xml +++ b/src/qtmsbuild/uic/qtuic.xml @@ -77,6 +77,16 @@ DisplayName="Qt Directory" Description="Path to installation of Qt."/> <StringProperty + Name="QtUicDir" + DisplayName="Output Directory" + Description="Specifies the path of the generated uic output directory." + Visible="false"/> + <StringProperty + Name="QtUicFileName" + DisplayName="Output File Name" + Description="Specifies the name of the generated uic output file." + Visible="false"/> + <StringProperty Name="InputFile" HelpUrl="http://doc.qt.io/qt-5/uic.html" DisplayName="Input File" diff --git a/src/qtmsbuild/uic/qtuic_settings.xml b/src/qtmsbuild/uic/qtuic_settings.xml new file mode 100644 index 00000000..57c73aea --- /dev/null +++ b/src/qtmsbuild/uic/qtuic_settings.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt VS Tools. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<ProjectSchemaDefinitions + xmlns="http://schemas.microsoft.com/build/2009/properties" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:sys="clr-namespace:System;assembly=mscorlib"> + <Rule + Name="QtRule50_Uic" + OverrideMode="Extend" + PageTemplate="tool" + DisplayName="Qt User Interface Compiler" + Order="9"> + <Rule.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="QtUic" /> + </Rule.DataSource> + <StringProperty + Name="QTDIR" + DisplayName="Qt Directory" + Visible="false"/> + <StringProperty + Name="InputFile" + DisplayName="Input File" + Visible="false"/> + <StringProperty + Name="OutputFile" + DisplayName="Output File" + Visible="false"/> + <StringProperty + Name="QtUicDir" + DisplayName="Output Directory" + Description="Specifies the path of the generated uic output directory."/> + <StringProperty + Name="QtUicFileName" + DisplayName="Output File Name" + Description="Specifies the name of the generated uic output file."/> + </Rule> +</ProjectSchemaDefinitions> diff --git a/src/qtvstools/QtVsTools.csproj b/src/qtvstools/QtVsTools.csproj index 5c357068..54ab5cd1 100644 --- a/src/qtvstools/QtVsTools.csproj +++ b/src/qtvstools/QtVsTools.csproj @@ -592,6 +592,12 @@ <IncludeInVSIX>true</IncludeInVSIX> <SubType>Designer</SubType> </Content> + <Content Include="..\qtmsbuild\moc\qtmoc_settings.xml"> + <Link>QtMsBuild\moc\qtmoc_settings.xml</Link> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + <IncludeInVSIX>true</IncludeInVSIX> + <SubType>Designer</SubType> + </Content> <!-- /////////////////////////////////////////////////////////////////////////////////////////////// // Qt/MSBuild qml property pages and targets @@ -647,6 +653,12 @@ <CopyToOutputDirectory>Always</CopyToOutputDirectory> <IncludeInVSIX>true</IncludeInVSIX> </Content> + <Content Include="..\qtmsbuild\rcc\qtrcc_settings.xml"> + <Link>QtMsBuild\rcc\qtrcc_settings.xml</Link> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + <IncludeInVSIX>true</IncludeInVSIX> + <SubType>Designer</SubType> + </Content> <!-- /////////////////////////////////////////////////////////////////////////////////////////////// // Qt/MSBuild repc property pages and targets @@ -700,6 +712,12 @@ <CopyToOutputDirectory>Always</CopyToOutputDirectory> <IncludeInVSIX>true</IncludeInVSIX> </Content> + <Content Include="..\qtmsbuild\uic\qtuic_settings.xml"> + <Link>QtMsBuild\uic\qtuic_settings.xml</Link> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + <IncludeInVSIX>true</IncludeInVSIX> + <SubType>Designer</SubType> + </Content> </ItemGroup> <Target Name="CheckT4Templates" BeforeTargets="Build" Inputs="%(T4Template.FullPath);%(T4Template.DependsOn)" Outputs="@(T4Template->'%(OutputFile)')"> <Error Text="T4 template '%(T4Template.FullPath)' out-of-date; update by selecting "Build" > "Transform All T4 Templates"" /> |