aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Costa <miguel.costa@qt.io>2019-07-08 16:16:15 +0200
committerMiguel Costa <miguel.costa@qt.io>2019-08-05 09:24:17 +0000
commitcff73364c3b632a84ab3c7ca2f2ea32b563910ce (patch)
tree41d0c87644f3322aa29709bae3d58529511cd7fc
parent3e7709dcf5927f5674cccc253ecefae3ab758166 (diff)
Add C++ compiler properties to Qt tools
Qt tools that generate C++ code will now include all properties available in the C++ compiler property page, allowing the default values of the C++ compiler properties to be used directly by the Qt tools, without the need to actively monitor changes to maintain properties synchronized. It is also possible to extend (i.e. append to) or override (i.e. replace) the default C++ property values for Qt tools. Task-number: QTVSADDINBUG-575 Task-number: QTVSADDINBUG-632 Change-Id: I456ee6b4926cd11c83c845656a617a4fb204542a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--.gitignore6
-rw-r--r--src/common.tt45
-rw-r--r--src/qtmsbuild/moc/qtmoc.targets12
-rw-r--r--src/qtmsbuild/moc/qtmoc_cl.targets_TT143
-rw-r--r--src/qtmsbuild/moc/qtmoc_cl.xml_TT112
-rw-r--r--src/qtmsbuild/qt.props8
-rw-r--r--src/qtmsbuild/qt.targets3
-rw-r--r--src/qtmsbuild/qt_globals.targets5
-rw-r--r--src/qtmsbuild/rcc/qtrcc.targets12
-rw-r--r--src/qtmsbuild/rcc/qtrcc_cl.targets_TT103
-rw-r--r--src/qtmsbuild/rcc/qtrcc_cl.xml_TT109
-rw-r--r--src/qtmsbuild/repc/qtrepc.targets12
-rw-r--r--src/qtmsbuild/repc/qtrepc_cl.targets_TT121
-rw-r--r--src/qtmsbuild/repc/qtrepc_cl.xml_TT112
-rw-r--r--src/qtprojectlib/ProjectExporter.cs6
-rw-r--r--src/qtprojectlib/QtProject.cs7
-rw-r--r--src/qtprojectlib/Resources.cs3
-rw-r--r--src/qtvstools/DteEventsHandler.cs6
-rw-r--r--src/qtvstools/QtVsTools.csproj99
19 files changed, 924 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 824abebe..7fcb86e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -297,3 +297,9 @@ src/qttemplates/server/server.vstemplate
src/qtvstools/QtMenus.vsct
MSBuild.MetaInfo.cs
src/qtvstools/Marketplace/Overview.html
+src/qtmsbuild/moc/qtmoc_cl.xml
+src/qtmsbuild/moc/qtmoc_cl.targets
+src/qtmsbuild/rcc/qtrcc_cl.xml
+src/qtmsbuild/rcc/qtrcc_cl.targets
+src/qtmsbuild/repc/qtrepc_cl.xml
+src/qtmsbuild/repc/qtrepc_cl.targets
diff --git a/src/common.tt b/src/common.tt
index bc5342e8..d8edd875 100644
--- a/src/common.tt
+++ b/src/common.tt
@@ -1,7 +1,14 @@
<#@template hostspecific="true" language="C#" #>
<#@assembly Name="System.Core" #>
+<#@assembly Name="System.Xml" #>
+<#@assembly Name="System.Xml.Linq" #>
<#@import namespace="System" #>
+<#@import namespace="System.Collections.Generic" #>
<#@import namespace="System.IO" #>
+<#@import namespace="System.Linq" #>
+<#@import namespace="System.Text" #>
+<#@import namespace="System.Xml" #>
+<#@import namespace="System.Xml.Linq" #>
<#@assembly name="EnvDTE" #>
<#@import namespace="EnvDTE" #>
<#
@@ -39,8 +46,46 @@
VS_VERSION.StartsWith("15.") ? "2017" :
VS_VERSION.StartsWith("14.") ? "2015" :
VS_VERSION.StartsWith("12.") ? "2013" : "????";
+ string VS_EDITION = Dte.Edition;
+ string VC_TARGETS_PATH = Path.Combine(
+ Environment.GetEnvironmentVariable("ProgramFiles(x86)"),
+ VS_VERSION.StartsWith("16.") ?
+ @"Microsoft Visual Studio\2019\" + VS_EDITION + @"\MSBuild\Microsoft\VC\v160" :
+ VS_VERSION.StartsWith("15.") ?
+ @"Microsoft Visual Studio\2017\" + VS_EDITION + @"\Common7\IDE\VC\VCTargets" :
+ VS_VERSION.StartsWith("14.") ?
+ @"MSBuild\Microsoft.Cpp\v4.0\V140" :
+ VS_VERSION.StartsWith("12.") ?
+ @"MSBuild\Microsoft.Cpp\v4.0\V120" : null);
/***************************************************************************/
string WARNING_GENERATED_FILE = "This file was generated automatically.";
string XML_COMMENT_BEGIN = "<!--";
string XML_COMMENT_END = "-->";
+
+ var XmlLoad = new Func<string, XElement>(xmlText =>
+ {
+ XDocument xmlDoc = null;
+ using (var reader = XmlReader.Create(new StringReader(xmlText)))
+ xmlDoc = XDocument.Load(reader);
+ var xmlRoot = xmlDoc.Root;
+ xmlRoot.Descendants().ToList().ForEach(x => x.Name = x.Name.LocalName);
+ return xmlRoot;
+ });
+
+ var XmlPrint = new Func<IEnumerable<XElement>, string>(x =>
+ {
+ var xmlOut = new StringBuilder();
+ var xmlOutSettings = new XmlWriterSettings()
+ {
+ ConformanceLevel = ConformanceLevel.Fragment,
+ OmitXmlDeclaration = true,
+ Indent = true,
+ };
+ using (var xmlOutWriter = XmlWriter.Create(xmlOut, xmlOutSettings)) {
+ foreach (var y in x)
+ y.WriteTo(xmlOutWriter);
+ }
+ return xmlOut.ToString();
+ });
+
#> \ No newline at end of file
diff --git a/src/qtmsbuild/moc/qtmoc.targets b/src/qtmsbuild/moc/qtmoc.targets
index acbdc89a..276a16ae 100644
--- a/src/qtmsbuild/moc/qtmoc.targets
+++ b/src/qtmsbuild/moc/qtmoc.targets
@@ -61,6 +61,9 @@
<PropertyPageSchema
Condition="'$(QtVsProjectSettings)' == 'true'"
Include="$(MSBuildThisFileDirectory)qtmoc_settings.xml" />
+ <PropertyPageSchema
+ Condition="'$(QtVsProjectClProperties)' == 'true'"
+ Include="$(MSBuildThisFileDirectory)qtmoc_cl.xml" />
<AvailableItemName Include="QtMoc">
<Targets>Qt;_ClCompile</Targets>
</AvailableItemName>
@@ -154,6 +157,14 @@
<!--
/////////////////////////////////////////////////////////////////////////////////////////////////
+ /// TARGET QtMocOverrideCpp
+ /////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // -->
+ <Import Project="qtmoc_cl.targets"/>
+
+ <!--
+ /////////////////////////////////////////////////////////////////////////////////////////////////
/// TARGET QtMoc
/////////////////////////////////////////////////////////////////////////////////////////////////
// Process each source file and produce the corresponding QtWork items
@@ -163,6 +174,7 @@
QtPrepare;
QtMocPrepare;
QtMocSetModified;
+ QtMocOverrideCpp;
$(QtMocDependsOn)
</QtMocDependsOn>
</PropertyGroup>
diff --git a/src/qtmsbuild/moc/qtmoc_cl.targets_TT b/src/qtmsbuild/moc/qtmoc_cl.targets_TT
new file mode 100644
index 00000000..71409511
--- /dev/null
+++ b/src/qtmsbuild/moc/qtmoc_cl.targets_TT
@@ -0,0 +1,143 @@
+<?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$
+ **
+ *****************************************************************************
+<#@output extension="targets" #>
+<#@include file="$(SolutionDir)\common.tt" #>
+<#@assembly Name="System.Xml" #>
+<#@assembly Name="System.Xml.Linq" #>
+<#@import namespace="System.Collections.Generic" #>
+<#@import namespace="System.Linq" #>
+<#@import namespace="System.Text" #>
+<#@import namespace="System.Xml" #>
+<#@import namespace="System.Xml.Linq" #>
+<#
+ var pathRuleCl = Path.Combine(VC_TARGETS_PATH, "1033", "cl.xml");
+ var xmlRule = XmlLoad(File.ReadAllText(pathRuleCl, Encoding.UTF8));
+#>
+ ** <#=WARNING_GENERATED_FILE#>
+ *****************************************************************************
+-->
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Target Name="QtMocOverrideCpp" DependsOnTargets="QtMocPrepare"
+ Inputs="%(QtMoc.Identity)" Outputs="@(QtMoc->'####### Don't skip this target #######')">
+
+ <Message Importance="High" Condition="'$(QtDebug)' == 'true'"
+ Text="## QtMocOverrideCpp @(QtMoc)" />
+
+ <PropertyGroup Condition="'$(QtVsProjectClProperties)' == 'true'">
+ <override_cl_compile>%(QtMoc.OverrideClCompile)</override_cl_compile>
+ </PropertyGroup>
+
+ <ItemGroup Condition="'$(override_cl_compile)' == 'extend'">
+ <QtMoc>
+ <!-- BEGIN Generated Text <#=XML_COMMENT_END#>
+<#=
+XmlPrint(xmlRule.Elements()
+ .Where(x => x.Name.ToString().Equals("StringListProperty"))
+ .Where(x => (string)x.Attribute("Visible") != "false")
+ .Where(x => (string)x.Attribute("Category") != "Command Line")
+ .Where(x => !x.Descendants("DataSource").Any())
+ .Select(x => new XElement((string)x.Attribute("Name"),
+ string.Format(
+ "@(ClCompile->WithMetadataValue('Identity','DefaultClCompile')->'%({0})');%(QtMoc.{0})",
+ (string)x.Attribute("Name")))))
+#>
+ <#=XML_COMMENT_BEGIN#> END Generated Text -->
+ </QtMoc>
+ <QtMoc>
+ <IncludePath>%(QtMoc.AdditionalIncludeDirectories)</IncludePath>
+ <Define>%(QtMoc.PreprocessorDefinitions)</Define>
+ <Undefine>%(QtMoc.UndefinePreprocessorDefinitions)</Undefine>
+ </QtMoc>
+ </ItemGroup>
+
+ <ItemGroup Condition="'$(override_cl_compile)' == 'replace'">
+ <QtMoc>
+ <IncludePath Condition="'%(QtMoc.AdditionalIncludeDirectories)' != ''"
+ >%(QtMoc.AdditionalIncludeDirectories)</IncludePath>
+ <IncludePath Condition="'%(QtMoc.AdditionalIncludeDirectories)' == ''"
+ >@(ClCompile->
+ WithMetadataValue('Identity', 'DefaultClCompile')->
+ '%(AdditionalIncludeDirectories)')</IncludePath>
+ <Define Condition="'%(QtMoc.PreprocessorDefinitions)' != ''"
+ >%(QtMoc.PreprocessorDefinitions)</Define>
+ <Define Condition="'%(QtMoc.PreprocessorDefinitions)' == ''"
+ >@(ClCompile->
+ WithMetadataValue('Identity','DefaultClCompile')->
+ '%(PreprocessorDefinitions)')</Define>
+ <Undefine Condition="'%(QtMoc.UndefinePreprocessorDefinitions)' == ''"
+ >%(QtMoc.UndefinePreprocessorDefinitions)</Undefine>
+ <Undefine Condition="'%(QtMoc.UndefinePreprocessorDefinitions)' != ''"
+ >@(ClCompile->
+ WithMetadataValue('Identity','DefaultClCompile')->
+ '%(UndefinePreprocessorDefinitions)')</Undefine>
+ </QtMoc>
+ </ItemGroup>
+
+ <ItemGroup Condition="'$(override_cl_compile)' == 'false'">
+ <QtMoc>
+ <!-- BEGIN Generated Text <#=XML_COMMENT_END#>
+<#=
+XmlPrint(xmlRule.Elements()
+ .Where(x => x.Name.ToString().EndsWith("Property"))
+ .Where(x => (string)x.Attribute("Visible") != "false")
+ .Where(x => (string)x.Attribute("Category") != "Command Line")
+ .Where(x => !x.Descendants("DataSource").Any())
+ .Select(x => new XElement((string)x.Attribute("Name"),
+ new XAttribute("Condition",
+ string.Format("'%(QtMoc.{0})' != ''", (string)x.Attribute("Name"))),
+ string.Format(
+ "@(ClCompile->WithMetadataValue('Identity','DefaultClCompile')->'%({0})')",
+ (string)x.Attribute("Name")))))
+#>
+ <#=XML_COMMENT_BEGIN#> END Generated Text -->
+ <IncludePath
+ >@(ClCompile->
+ WithMetadataValue('Identity','DefaultClCompile')->
+ '%(AdditionalIncludeDirectories)')</IncludePath>
+ <Define
+ >@(ClCompile->
+ WithMetadataValue('Identity','DefaultClCompile')->
+ '%(PreprocessorDefinitions)')</Define>
+ <Undefine
+ >@(ClCompile->
+ WithMetadataValue('Identity','DefaultClCompile')->
+ '%(UndefinePreprocessorDefinitions)')</Undefine>
+ </QtMoc>
+ </ItemGroup>
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////////////
+ // Clean-up
+ // -->
+ <PropertyGroup>
+ <override_cl_compile/>
+ </PropertyGroup>
+ </Target>
+</Project>
diff --git a/src/qtmsbuild/moc/qtmoc_cl.xml_TT b/src/qtmsbuild/moc/qtmoc_cl.xml_TT
new file mode 100644
index 00000000..77c3c116
--- /dev/null
+++ b/src/qtmsbuild/moc/qtmoc_cl.xml_TT
@@ -0,0 +1,112 @@
+<?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$
+ **
+ *****************************************************************************
+<#@output extension="xml" #>
+<#@include file="$(SolutionDir)\common.tt" #>
+<#@assembly Name="System.Xml" #>
+<#@assembly Name="System.Xml.Linq" #>
+<#@import namespace="System.Collections.Generic" #>
+<#@import namespace="System.Linq" #>
+<#@import namespace="System.Text" #>
+<#@import namespace="System.Xml" #>
+<#@import namespace="System.Xml.Linq" #>
+<#
+ var pathRuleCl = Path.Combine(VC_TARGETS_PATH, "1033", "cl.xml");
+ var xmlRule = XmlLoad(File.ReadAllText(pathRuleCl, Encoding.UTF8));
+ var categoryNames = xmlRule
+ .Elements("Rule.Categories")
+ .Elements("Category")
+ .Where(x => x.Attribute("Subtype") == null)
+ .ToDictionary(
+ x => (string)x.Attribute("Name"),
+ x => (string)x.Attribute("DisplayName"));
+#>
+ ** <#=WARNING_GENERATED_FILE#>
+ *****************************************************************************
+-->
+
+<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>
+ <Rule.Categories>
+ <Category Name="MocCpp" DisplayName="Override C/C++"/>
+ </Rule.Categories>
+ <EnumProperty
+ Name="OverrideClCompile"
+ Category="MocCpp"
+ DisplayName="Override C/C++ Properties"
+ Description="Define how C/C++ properties are redefined for moc">
+ <EnumValue Name="extend" DisplayName=
+"Extend (append override definitions to C/C++ list properties; replace other properties)"/>
+ <EnumValue Name="replace" DisplayName=
+"Replace (use override definitions instead of C/C++ properties)"/>
+ <EnumValue Name="false" DisplayName=
+"Disabled (use C/C++ properties; ignore override definitions)"/>
+ </EnumProperty>
+ <StringListProperty Name="IncludePath" Switch="&quot;-I[value]&quot;" Visible="false"/>
+ <StringListProperty Name="Define" Switch="-D " Visible="false"/>
+ <StringListProperty Name="Undefine" Switch="-U[value]" Visible="false"/>
+ <!-- BEGIN Generated Text <#=XML_COMMENT_END#>
+<#=
+XmlPrint(xmlRule.Elements()
+ .Where(x => x.Name.ToString().EndsWith("Property"))
+ .Where(x => (string)x.Attribute("Visible") != "false")
+ .Where(x => (string)x.Attribute("Category") != "Command Line")
+ .Where(x => !x.Descendants("DataSource").Any())
+ .GroupBy(x => (string)x.Attribute("Category"))
+ .SelectMany(y => y.Select(x =>
+ {
+ x = new XElement(x);
+ x.SetAttributeValue("Category", "MocCpp");
+ x.SetAttributeValue("Description", "(overrides C/C++ property) "
+ + (string)x.Attribute("Description"));
+ return x;
+ })
+ .Prepend(new XElement("StringProperty",
+ new XAttribute("Name", "QtCppHeader_" + y.Key.Replace(' ', '_')),
+ new XAttribute("Category", "MocCpp"),
+ new XAttribute("ReadOnly", "true"),
+ new XAttribute("DisplayName", string.Format("{0} {1} {2}",
+ new string('#', 10), categoryNames[y.Key], new string('#', 30)))))))
+#>
+ <#=XML_COMMENT_BEGIN#> END Generated Text -->
+ </Rule>
+</ProjectSchemaDefinitions>
diff --git a/src/qtmsbuild/qt.props b/src/qtmsbuild/qt.props
index 9a948da4..4f7fa0d5 100644
--- a/src/qtmsbuild/qt.props
+++ b/src/qtmsbuild/qt.props
@@ -42,6 +42,7 @@
<PropertyGroup>
<QtVsProjectVersion>0</QtVsProjectVersion>
<QtVsProjectMinVersion_Settings>300</QtVsProjectMinVersion_Settings>
+ <QtVsProjectMinVersion_ClProperties>300</QtVsProjectMinVersion_ClProperties>
</PropertyGroup>
<PropertyGroup Condition="'$(Keyword)' != ''">
@@ -53,6 +54,13 @@
>true</QtVsProjectSettings>
<QtVsProjectSettings Condition="$(QtVsProjectVersion) &lt; $(QtVsProjectMinVersion_Settings)"
>false</QtVsProjectSettings>
+
+ <QtVsProjectClProperties
+ Condition="$(QtVsProjectVersion) &gt;= $(QtVsProjectMinVersion_ClProperties)"
+ >true</QtVsProjectClProperties>
+ <QtVsProjectClProperties
+ Condition="$(QtVsProjectVersion) &lt; $(QtVsProjectMinVersion_ClProperties)"
+ >false</QtVsProjectClProperties>
</PropertyGroup>
<!--
diff --git a/src/qtmsbuild/qt.targets b/src/qtmsbuild/qt.targets
index cc3a5064..df0ec430 100644
--- a/src/qtmsbuild/qt.targets
+++ b/src/qtmsbuild/qt.targets
@@ -45,6 +45,9 @@
<QtVsProjectMinVersion_Settings
Condition="'$(QtVsProjectMinVersion_Settings)' == ''"
>0</QtVsProjectMinVersion_Settings>
+ <QtVsProjectMinVersion_ClProperties
+ Condition="'$(QtVsProjectMinVersion_ClProperties)' == ''"
+ >0</QtVsProjectMinVersion_ClProperties>
</PropertyGroup>
<!--
diff --git a/src/qtmsbuild/qt_globals.targets b/src/qtmsbuild/qt_globals.targets
index b979046b..e3be06f8 100644
--- a/src/qtmsbuild/qt_globals.targets
+++ b/src/qtmsbuild/qt_globals.targets
@@ -91,6 +91,10 @@
<Message Importance="High" Condition="'$(QtDebug)' == 'true'" Text="#### QtPrepare"/>
+ <ItemGroup>
+ <ClCompile Include="DefaultClCompile" />
+ </ItemGroup>
+
<ReadLinesFromFile File="$(QtLogFilePath)">
<Output TaskParameter="Lines" ItemName="QtLogData"/>
</ReadLinesFromFile>
@@ -352,6 +356,7 @@
<read_log Remove="@(read_log)"/>
<write_log Remove="@(write_log)"/>
<clean_log Remove="@(clean_log)"/>
+ <ClCompile Remove="DefaultClCompile" />
</ItemGroup>
</Target>
diff --git a/src/qtmsbuild/rcc/qtrcc.targets b/src/qtmsbuild/rcc/qtrcc.targets
index 8082bf80..292febe4 100644
--- a/src/qtmsbuild/rcc/qtrcc.targets
+++ b/src/qtmsbuild/rcc/qtrcc.targets
@@ -61,6 +61,9 @@
<PropertyPageSchema
Condition="'$(QtVsProjectSettings)' == 'true'"
Include="$(MSBuildThisFileDirectory)qtrcc_settings.xml" />
+ <PropertyPageSchema
+ Condition="'$(QtVsProjectClProperties)' == 'true'"
+ Include="$(MSBuildThisFileDirectory)qtrcc_cl.xml" />
<AvailableItemName Include="QtRcc">
<Targets>Qt;_ClCompile</Targets>
</AvailableItemName>
@@ -201,6 +204,14 @@
<!--
/////////////////////////////////////////////////////////////////////////////////////////////////
+ /// TARGET QtRccOverrideCpp
+ /////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // -->
+ <Import Project="qtrcc_cl.targets"/>
+
+ <!--
+ /////////////////////////////////////////////////////////////////////////////////////////////////
/// TARGET QtRcc
/////////////////////////////////////////////////////////////////////////////////////////////////
// Process each QRC file and produce the corresponding QtWork items
@@ -210,6 +221,7 @@
QtPrepare;
QtRccPrepare;
QtRccSetModified;
+ QtRccOverrideCpp;
$(QtRccDependsOn)
</QtRccDependsOn>
</PropertyGroup>
diff --git a/src/qtmsbuild/rcc/qtrcc_cl.targets_TT b/src/qtmsbuild/rcc/qtrcc_cl.targets_TT
new file mode 100644
index 00000000..d62dfc6a
--- /dev/null
+++ b/src/qtmsbuild/rcc/qtrcc_cl.targets_TT
@@ -0,0 +1,103 @@
+<?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$
+ **
+ *****************************************************************************
+<#@output extension="targets" #>
+<#@include file="$(SolutionDir)\common.tt" #>
+<#@assembly Name="System.Xml" #>
+<#@assembly Name="System.Xml.Linq" #>
+<#@import namespace="System.Collections.Generic" #>
+<#@import namespace="System.Linq" #>
+<#@import namespace="System.Text" #>
+<#@import namespace="System.Xml" #>
+<#@import namespace="System.Xml.Linq" #>
+<#
+ var pathRuleCl = Path.Combine(VC_TARGETS_PATH, "1033", "cl.xml");
+ var xmlRule = XmlLoad(File.ReadAllText(pathRuleCl, Encoding.UTF8));
+#>
+ ** <#=WARNING_GENERATED_FILE#>
+ *****************************************************************************
+-->
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Target Name="QtRccOverrideCpp" DependsOnTargets="QtRccPrepare"
+ Inputs="%(QtRcc.Identity)" Outputs="@(QtRcc->'####### Don't skip this target #######')">
+
+ <Message Importance="High" Condition="'$(QtDebug)' == 'true'"
+ Text="## QtRccOverrideCpp @(QtRcc)" />
+
+ <PropertyGroup Condition="'$(QtVsProjectClProperties)' == 'true'">
+ <override_cl_compile>%(QtRcc.OverrideClCompile)</override_cl_compile>
+ </PropertyGroup>
+
+ <ItemGroup Condition="'$(override_cl_compile)' == 'extend'">
+ <QtRcc>
+ <!-- BEGIN Generated Text <#=XML_COMMENT_END#>
+<#=
+XmlPrint(xmlRule.Elements()
+ .Where(x => x.Name.ToString().Equals("StringListProperty"))
+ .Where(x => (string)x.Attribute("Visible") != "false")
+ .Where(x => (string)x.Attribute("Category") != "Command Line")
+ .Where(x => !x.Descendants("DataSource").Any())
+ .Select(x => new XElement((string)x.Attribute("Name"),
+ string.Format(
+ "@(ClCompile->WithMetadataValue('Identity','DefaultClCompile')->'%({0})');%(QtRcc.{0})",
+ (string)x.Attribute("Name")))))
+#>
+ <#=XML_COMMENT_BEGIN#> END Generated Text -->
+ </QtRcc>
+ </ItemGroup>
+
+ <ItemGroup Condition="'$(override_cl_compile)' == 'false'">
+ <QtRcc>
+ <!-- BEGIN Generated Text <#=XML_COMMENT_END#>
+<#=
+XmlPrint(xmlRule.Elements()
+ .Where(x => x.Name.ToString().EndsWith("Property"))
+ .Where(x => (string)x.Attribute("Visible") != "false")
+ .Where(x => (string)x.Attribute("Category") != "Command Line")
+ .Where(x => !x.Descendants("DataSource").Any())
+ .Select(x => new XElement((string)x.Attribute("Name"),
+ new XAttribute("Condition",
+ string.Format("'%(QtRcc.{0})' != ''", (string)x.Attribute("Name"))),
+ string.Format(
+ "@(ClCompile->WithMetadataValue('Identity','DefaultClCompile')->'%({0})')",
+ (string)x.Attribute("Name")))))
+#>
+ <#=XML_COMMENT_BEGIN#> END Generated Text -->
+ </QtRcc>
+ </ItemGroup>
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////////////
+ // Clean-up
+ // -->
+ <PropertyGroup>
+ <override_cl_compile/>
+ </PropertyGroup>
+ </Target>
+</Project>
diff --git a/src/qtmsbuild/rcc/qtrcc_cl.xml_TT b/src/qtmsbuild/rcc/qtrcc_cl.xml_TT
new file mode 100644
index 00000000..63da25a6
--- /dev/null
+++ b/src/qtmsbuild/rcc/qtrcc_cl.xml_TT
@@ -0,0 +1,109 @@
+<?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$
+ **
+ *****************************************************************************
+<#@output extension="xml" #>
+<#@include file="$(SolutionDir)\common.tt" #>
+<#@assembly Name="System.Xml" #>
+<#@assembly Name="System.Xml.Linq" #>
+<#@import namespace="System.Collections.Generic" #>
+<#@import namespace="System.Linq" #>
+<#@import namespace="System.Text" #>
+<#@import namespace="System.Xml" #>
+<#@import namespace="System.Xml.Linq" #>
+<#
+ var pathRuleCl = Path.Combine(VC_TARGETS_PATH, "1033", "cl.xml");
+ var xmlRule = XmlLoad(File.ReadAllText(pathRuleCl, Encoding.UTF8));
+ var categoryNames = xmlRule
+ .Elements("Rule.Categories")
+ .Elements("Category")
+ .Where(x => x.Attribute("Subtype") == null)
+ .ToDictionary(
+ x => (string)x.Attribute("Name"),
+ x => (string)x.Attribute("DisplayName"));
+#>
+ ** <#=WARNING_GENERATED_FILE#>
+ *****************************************************************************
+-->
+
+<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>
+ <Rule.Categories>
+ <Category Name="RccCpp" DisplayName="Override C/C++"/>
+ </Rule.Categories>
+ <EnumProperty
+ Name="OverrideClCompile"
+ Category="RccCpp"
+ DisplayName="Override C/C++ Properties"
+ Description="Define how C/C++ properties are redefined for rcc">
+ <EnumValue Name="extend" DisplayName=
+"Extend (append override definitions to C/C++ list properties; replace other properties)"/>
+ <EnumValue Name="replace" DisplayName=
+"Replace (use override definitions instead of C/C++ properties)"/>
+ <EnumValue Name="false" DisplayName=
+"Disabled (use C/C++ properties; ignore override definitions)"/>
+ </EnumProperty>
+ <!-- BEGIN Generated Text <#=XML_COMMENT_END#>
+<#=
+XmlPrint(xmlRule.Elements()
+ .Where(x => x.Name.ToString().EndsWith("Property"))
+ .Where(x => (string)x.Attribute("Visible") != "false")
+ .Where(x => (string)x.Attribute("Category") != "Command Line")
+ .Where(x => !x.Descendants("DataSource").Any())
+ .GroupBy(x => (string)x.Attribute("Category"))
+ .SelectMany(y => y.Select(x =>
+ {
+ x = new XElement(x);
+ x.SetAttributeValue("Category", "RccCpp");
+ x.SetAttributeValue("Description", "(overrides C/C++ property) "
+ + (string)x.Attribute("Description"));
+ return x;
+ })
+ .Prepend(new XElement("StringProperty",
+ new XAttribute("Name", "QtCppHeader_" + y.Key.Replace(' ', '_')),
+ new XAttribute("Category", "RccCpp"),
+ new XAttribute("ReadOnly", "true"),
+ new XAttribute("DisplayName", string.Format("{0} {1} {2}",
+ new string('#', 10), categoryNames[y.Key], new string('#', 30)))))))
+#>
+ <#=XML_COMMENT_BEGIN#> END Generated Text -->
+ </Rule>
+</ProjectSchemaDefinitions>
diff --git a/src/qtmsbuild/repc/qtrepc.targets b/src/qtmsbuild/repc/qtrepc.targets
index 94418476..4cf63a73 100644
--- a/src/qtmsbuild/repc/qtrepc.targets
+++ b/src/qtmsbuild/repc/qtrepc.targets
@@ -58,6 +58,9 @@
<ItemGroup>
<PropertyPageSchema
Include="$(MSBuildThisFileDirectory)qtrepc.xml" />
+ <PropertyPageSchema
+ Condition="'$(QtVsProjectClProperties)' == 'true'"
+ Include="$(MSBuildThisFileDirectory)qtrepc_cl.xml" />
<AvailableItemName Include="QtRepc">
<Targets>Qt</Targets>
</AvailableItemName>
@@ -147,6 +150,14 @@
<!--
/////////////////////////////////////////////////////////////////////////////////////////////////
+ /// TARGET QtRepcOverrideCpp
+ /////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // -->
+ <Import Project="qtrepc_cl.targets"/>
+
+ <!--
+ /////////////////////////////////////////////////////////////////////////////////////////////////
/// TARGET QtRepc
/////////////////////////////////////////////////////////////////////////////////////////////////
// Process each source file and produce the corresponding QtWork items
@@ -156,6 +167,7 @@
QtPrepare;
QtRepcPrepare;
QtRepcSetModified;
+ QtRepcOverrideCpp;
$(QtRepcDependsOn)
</QtRepcDependsOn>
</PropertyGroup>
diff --git a/src/qtmsbuild/repc/qtrepc_cl.targets_TT b/src/qtmsbuild/repc/qtrepc_cl.targets_TT
new file mode 100644
index 00000000..9270a848
--- /dev/null
+++ b/src/qtmsbuild/repc/qtrepc_cl.targets_TT
@@ -0,0 +1,121 @@
+<?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$
+ **
+ *****************************************************************************
+<#@output extension="targets" #>
+<#@include file="$(SolutionDir)\common.tt" #>
+<#@assembly Name="System.Xml" #>
+<#@assembly Name="System.Xml.Linq" #>
+<#@import namespace="System.Collections.Generic" #>
+<#@import namespace="System.Linq" #>
+<#@import namespace="System.Text" #>
+<#@import namespace="System.Xml" #>
+<#@import namespace="System.Xml.Linq" #>
+<#
+ var pathRuleCl = Path.Combine(VC_TARGETS_PATH, "1033", "cl.xml");
+ var xmlRule = XmlLoad(File.ReadAllText(pathRuleCl, Encoding.UTF8));
+#>
+ ** <#=WARNING_GENERATED_FILE#>
+ *****************************************************************************
+-->
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Target Name="QtRepcOverrideCpp" DependsOnTargets="QtRepcPrepare"
+ Inputs="%(QtRepc.Identity)" Outputs="@(QtRepc->'####### Don't skip this target #######')">
+
+ <Message Importance="High" Condition="'$(QtDebug)' == 'true'"
+ Text="## QtRepcOverrideCpp @(QtRepc)" />
+
+ <PropertyGroup Condition="'$(QtVsProjectClProperties)' == 'true'">
+ <override_cl_compile>%(QtRepc.OverrideClCompile)</override_cl_compile>
+ </PropertyGroup>
+
+ <ItemGroup Condition="'$(override_cl_compile)' == 'extend'">
+ <QtRepc>
+ <!-- BEGIN Generated Text <#=XML_COMMENT_END#>
+<#=
+XmlPrint(xmlRule.Elements()
+ .Where(x => x.Name.ToString().Equals("StringListProperty"))
+ .Where(x => (string)x.Attribute("Visible") != "false")
+ .Where(x => (string)x.Attribute("Category") != "Command Line")
+ .Where(x => !x.Descendants("DataSource").Any())
+ .Select(x => new XElement((string)x.Attribute("Name"),
+ string.Format(
+"@(ClCompile->WithMetadataValue('Identity','DefaultClCompile')->'%({0})');%(QtRepc.{0})",
+ (string)x.Attribute("Name")))))
+#>
+ <#=XML_COMMENT_BEGIN#> END Generated Text -->
+ </QtRepc>
+ <QtRepc>
+ <IncludePath>%(QtRepc.AdditionalIncludeDirectories)</IncludePath>
+ </QtRepc>
+ </ItemGroup>
+
+ <ItemGroup Condition="'$(override_cl_compile)' == 'replace'">
+ <QtRepc>
+ <IncludePath Condition="'%(QtRepc.AdditionalIncludeDirectories)' != ''"
+ >%(QtRepc.AdditionalIncludeDirectories)</IncludePath>
+ <IncludePath Condition="'%(QtRepc.AdditionalIncludeDirectories)' == ''"
+ >@(ClCompile->
+ WithMetadataValue('Identity','DefaultClCompile')->
+ '%(AdditionalIncludeDirectories)')</IncludePath>
+ </QtRepc>
+ </ItemGroup>
+
+ <ItemGroup Condition="'$(override_cl_compile)' == 'false'">
+ <QtRepc>
+ <!-- BEGIN Generated Text <#=XML_COMMENT_END#>
+<#=
+XmlPrint(xmlRule.Elements()
+ .Where(x => x.Name.ToString().EndsWith("Property"))
+ .Where(x => (string)x.Attribute("Visible") != "false")
+ .Where(x => (string)x.Attribute("Category") != "Command Line")
+ .Where(x => !x.Descendants("DataSource").Any())
+ .Select(x => new XElement((string)x.Attribute("Name"),
+ new XAttribute("Condition",
+ string.Format("'%(QtRepc.{0})' != ''", (string)x.Attribute("Name"))),
+ string.Format(
+ "@(ClCompile->WithMetadataValue('Identity','DefaultClCompile')->'%({0})')",
+ (string)x.Attribute("Name")))))
+#>
+ <#=XML_COMMENT_BEGIN#> END Generated Text -->
+ <IncludePath
+ >@(ClCompile->
+ WithMetadataValue('Identity','DefaultClCompile')->
+ '%(AdditionalIncludeDirectories)')</IncludePath>
+ </QtRepc>
+ </ItemGroup>
+
+ <!--
+ ///////////////////////////////////////////////////////////////////////////////////////////////
+ // Clean-up
+ // -->
+ <PropertyGroup>
+ <override_cl_compile/>
+ </PropertyGroup>
+ </Target>
+</Project>
diff --git a/src/qtmsbuild/repc/qtrepc_cl.xml_TT b/src/qtmsbuild/repc/qtrepc_cl.xml_TT
new file mode 100644
index 00000000..563c7bda
--- /dev/null
+++ b/src/qtmsbuild/repc/qtrepc_cl.xml_TT
@@ -0,0 +1,112 @@
+<?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$
+ **
+ *****************************************************************************
+<#@output extension="xml" #>
+<#@include file="$(SolutionDir)\common.tt" #>
+<#@assembly Name="System.Xml" #>
+<#@assembly Name="System.Xml.Linq" #>
+<#@import namespace="System.Collections.Generic" #>
+<#@import namespace="System.Linq" #>
+<#@import namespace="System.Text" #>
+<#@import namespace="System.Xml" #>
+<#@import namespace="System.Xml.Linq" #>
+<#
+ var pathRuleCl = Path.Combine(VC_TARGETS_PATH, "1033", "cl.xml");
+ var xmlRule = XmlLoad(File.ReadAllText(pathRuleCl, Encoding.UTF8));
+ var categoryNames = xmlRule
+ .Elements("Rule.Categories")
+ .Elements("Category")
+ .Where(x => x.Attribute("Subtype") == null)
+ .ToDictionary(
+ x => (string)x.Attribute("Name"),
+ x => (string)x.Attribute("DisplayName"));
+#>
+ ** <#=WARNING_GENERATED_FILE#>
+ *****************************************************************************
+-->
+
+<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="QtRule60_Repc"
+ OverrideMode="Extend"
+ PageTemplate="tool"
+ DisplayName="Qt Remote Objects Compiler"
+ Order="9">
+ <Rule.DataSource>
+ <DataSource
+ Persistence="ProjectFile"
+ ItemType="QtRepc" />
+ </Rule.DataSource>
+ <Rule.Categories>
+ <Category Name="RepcCpp" DisplayName="Override C/C++"/>
+ </Rule.Categories>
+ <EnumProperty
+ Name="OverrideClCompile"
+ Category="RepcCpp"
+ DisplayName="Override C/C++ Properties"
+ Description="Define how C/C++ properties are redefined for Repc">
+ <EnumValue Name="extend" DisplayName=
+"Extend (append override definitions to C/C++ list properties; replace other properties)"/>
+ <EnumValue Name="replace" DisplayName=
+"Replace (use override definitions instead of C/C++ properties)"/>
+ <EnumValue Name="false" DisplayName=
+"Disabled (use C/C++ properties; ignore override definitions)"/>
+ </EnumProperty>
+ <StringListProperty Name="IncludePath" Switch="&quot;-I[value]&quot;" Visible="false"/>
+ <StringListProperty Name="Define" Switch="-D " Visible="false"/>
+ <StringListProperty Name="Undefine" Switch="-U[value]" Visible="false"/>
+ <!-- BEGIN Generated Text <#=XML_COMMENT_END#>
+<#=
+XmlPrint(xmlRule.Elements()
+ .Where(x => x.Name.ToString().EndsWith("Property"))
+ .Where(x => (string)x.Attribute("Visible") != "false")
+ .Where(x => (string)x.Attribute("Category") != "Command Line")
+ .Where(x => !x.Descendants("DataSource").Any())
+ .GroupBy(x => (string)x.Attribute("Category"))
+ .SelectMany(y => y.Select(x =>
+ {
+ x = new XElement(x);
+ x.SetAttributeValue("Category", "RepcCpp");
+ x.SetAttributeValue("Description", "(overrides C/C++ property) "
+ + (string)x.Attribute("Description"));
+ return x;
+ })
+ .Prepend(new XElement("StringProperty",
+ new XAttribute("Name", "QtCppHeader_" + y.Key.Replace(' ', '_')),
+ new XAttribute("Category", "RepcCpp"),
+ new XAttribute("ReadOnly", "true"),
+ new XAttribute("DisplayName", string.Format("{0} {1} {2}",
+ new string('#', 10), categoryNames[y.Key], new string('#', 30)))))))
+#>
+ <#=XML_COMMENT_BEGIN#> END Generated Text -->
+ </Rule>
+</ProjectSchemaDefinitions>
diff --git a/src/qtprojectlib/ProjectExporter.cs b/src/qtprojectlib/ProjectExporter.cs
index e70b6060..a1cbd7be 100644
--- a/src/qtprojectlib/ProjectExporter.cs
+++ b/src/qtprojectlib/ProjectExporter.cs
@@ -417,6 +417,9 @@ namespace QtProjectLib
private static void AddIncludePaths(Project project, ProFileOption option, string includePaths)
{
+ if (QtProject.GetFormatVersion(project) >= Resources.qtMinFormatVersion_ClProperties)
+ return;
+
if (includePaths == null)
return;
@@ -449,6 +452,9 @@ namespace QtProjectLib
private static void AddLibraries(Project project, ProFileOption option, string paths, string deps)
{
+ if (QtProject.GetFormatVersion(project) < Resources.qtMinFormatVersion_ClProperties)
+ return;
+
var versionManager = QtVersionManager.The();
var qtDir = versionManager.GetInstallPath(project);
if (qtDir == null)
diff --git a/src/qtprojectlib/QtProject.cs b/src/qtprojectlib/QtProject.cs
index 15067709..09aef94d 100644
--- a/src/qtprojectlib/QtProject.cs
+++ b/src/qtprojectlib/QtProject.cs
@@ -2312,6 +2312,9 @@ namespace QtProjectLib
public void AddActiveQtBuildStep(string version, string defFile = null)
{
+ if (FormatVersion < Resources.qtMinFormatVersion_ClProperties)
+ return;
+
foreach (VCConfiguration config in (IVCCollection) vcPro.Configurations) {
var idlFile = "\"$(IntDir)/" + envPro.Name + ".idl\"";
var tblFile = "\"$(IntDir)/" + envPro.Name + ".tlb\"";
@@ -2637,6 +2640,10 @@ namespace QtProjectLib
public void RefreshMocSteps()
{
+ // Ignore when using shared compiler properties
+ if (GetFormatVersion(vcPro) >= Resources.qtMinFormatVersion_ClProperties)
+ return;
+
var filesCollection = vcPro.Files as IVCCollection;
if (filesCollection == null)
return;
diff --git a/src/qtprojectlib/Resources.cs b/src/qtprojectlib/Resources.cs
index 65ad451f..68b36028 100644
--- a/src/qtprojectlib/Resources.cs
+++ b/src/qtprojectlib/Resources.cs
@@ -88,6 +88,9 @@ namespace QtProjectLib
// Min. format version for Qt settings as project properties
public const int qtMinFormatVersion_Settings = 300;
+ // Min. format version for shared compiler properties
+ public const int qtMinFormatVersion_ClProperties = 300;
+
// Project properties labels
public const string projLabelGlobals = "Globals";
public const string projLabelConfiguration = "Configuration";
diff --git a/src/qtvstools/DteEventsHandler.cs b/src/qtvstools/DteEventsHandler.cs
index 03c6da89..516bc585 100644
--- a/src/qtvstools/DteEventsHandler.cs
+++ b/src/qtvstools/DteEventsHandler.cs
@@ -598,6 +598,9 @@ namespace QtVsTools
return;
if (!HelperFunctions.IsQtProject(vcPrj))
return;
+ // Ignore property events when using shared compiler properties
+ if (QtProject.GetFormatVersion(vcPrj) >= Resources.qtMinFormatVersion_ClProperties)
+ return;
if (dispid == dispId_VCCLCompilerTool_UsePrecompiledHeader
|| dispid == dispId_VCCLCompilerTool_PrecompiledHeaderThrough
@@ -627,6 +630,9 @@ namespace QtVsTools
return;
if (!HelperFunctions.IsQtProject(vcPrj))
return;
+ // Ignore property events when using shared compiler properties
+ if (QtProject.GetFormatVersion(vcPrj) >= Resources.qtMinFormatVersion_ClProperties)
+ return;
if (dispid == dispId_VCFileConfiguration_ExcludedFromBuild) {
var qtPrj = QtProject.Create(vcPrj);
diff --git a/src/qtvstools/QtVsTools.csproj b/src/qtvstools/QtVsTools.csproj
index 54ab5cd1..d75c8d43 100644
--- a/src/qtvstools/QtVsTools.csproj
+++ b/src/qtvstools/QtVsTools.csproj
@@ -598,6 +598,39 @@
<IncludeInVSIX>true</IncludeInVSIX>
<SubType>Designer</SubType>
</Content>
+ <T4Template Include="..\qtmsbuild\moc\qtmoc_cl.xml_TT">
+ <Link>QtMsBuild\moc\qtmoc_cl.xml_TT</Link>
+ <Generator>TextTemplatingFileGenerator</Generator>
+ <OutputFile>..\qtmsbuild\moc\qtmoc_cl.xml</OutputFile>
+ <DependsOn>$(SolutionDir)\version.targets;$(SolutionDir)\version.tt;$(SolutionDir)\common.tt</DependsOn>
+ <LastGenOutput>qtmoc_cl.xml</LastGenOutput>
+ <SubType>Designer</SubType>
+ </T4Template>
+ <Content Include="..\qtmsbuild\moc\qtmoc_cl.xml">
+ <Link>QtMsBuild\moc\qtmoc_cl.xml</Link>
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>qtmoc_cl.xml_TT</DependentUpon>
+ <SubType>Designer</SubType>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <IncludeInVSIX>true</IncludeInVSIX>
+ </Content>
+ <T4Template Include="..\qtmsbuild\moc\qtmoc_cl.targets_TT">
+ <Link>QtMsBuild\moc\qtmoc_cl.targets_TT</Link>
+ <Generator>TextTemplatingFileGenerator</Generator>
+ <OutputFile>..\qtmsbuild\moc\qtmoc_cl.targets</OutputFile>
+ <DependsOn>$(SolutionDir)\version.targets;$(SolutionDir)\version.tt;$(SolutionDir)\common.tt</DependsOn>
+ <SubType>Designer</SubType>
+ <LastGenOutput>qtmoc_cl.targets</LastGenOutput>
+ </T4Template>
+ <Content Include="..\qtmsbuild\moc\qtmoc_cl.targets">
+ <Link>QtMsBuild\moc\qtmoc_cl.targets</Link>
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>qtmoc_cl.targets_TT</DependentUpon>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <IncludeInVSIX>true</IncludeInVSIX>
+ </Content>
<!--
///////////////////////////////////////////////////////////////////////////////////////////////
// Qt/MSBuild qml property pages and targets
@@ -659,6 +692,39 @@
<IncludeInVSIX>true</IncludeInVSIX>
<SubType>Designer</SubType>
</Content>
+ <T4Template Include="..\qtmsbuild\rcc\qtrcc_cl.xml_TT">
+ <Link>QtMsBuild\rcc\qtrcc_cl.xml_TT</Link>
+ <Generator>TextTemplatingFileGenerator</Generator>
+ <OutputFile>..\qtmsbuild\rcc\qtrcc_cl.xml</OutputFile>
+ <DependsOn>$(SolutionDir)\version.targets;$(SolutionDir)\version.tt;$(SolutionDir)\common.tt</DependsOn>
+ <LastGenOutput>qtrcc_cl.xml</LastGenOutput>
+ <SubType>Designer</SubType>
+ </T4Template>
+ <Content Include="..\qtmsbuild\rcc\qtrcc_cl.xml">
+ <Link>QtMsBuild\rcc\qtrcc_cl.xml</Link>
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>qtrcc_cl.xml_TT</DependentUpon>
+ <SubType>Designer</SubType>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <IncludeInVSIX>true</IncludeInVSIX>
+ </Content>
+ <T4Template Include="..\qtmsbuild\rcc\qtrcc_cl.targets_TT">
+ <Link>QtMsBuild\rcc\qtrcc_cl.targets_TT</Link>
+ <Generator>TextTemplatingFileGenerator</Generator>
+ <OutputFile>..\qtmsbuild\rcc\qtrcc_cl.targets</OutputFile>
+ <DependsOn>$(SolutionDir)\version.targets;$(SolutionDir)\version.tt;$(SolutionDir)\common.tt</DependsOn>
+ <SubType>Designer</SubType>
+ <LastGenOutput>qtrcc_cl.targets</LastGenOutput>
+ </T4Template>
+ <Content Include="..\qtmsbuild\rcc\qtrcc_cl.targets">
+ <Link>QtMsBuild\rcc\qtrcc_cl.targets</Link>
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>qtrcc_cl.targets_TT</DependentUpon>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <IncludeInVSIX>true</IncludeInVSIX>
+ </Content>
<!--
///////////////////////////////////////////////////////////////////////////////////////////////
// Qt/MSBuild repc property pages and targets
@@ -687,6 +753,39 @@
<IncludeInVSIX>true</IncludeInVSIX>
<SubType>Designer</SubType>
</Content>
+ <T4Template Include="..\qtmsbuild\repc\qtrepc_cl.xml_TT">
+ <Link>QtMsBuild\repc\qtrepc_cl.xml_TT</Link>
+ <Generator>TextTemplatingFileGenerator</Generator>
+ <OutputFile>..\qtmsbuild\repc\qtrepc_cl.xml</OutputFile>
+ <DependsOn>$(SolutionDir)\version.targets;$(SolutionDir)\version.tt;$(SolutionDir)\common.tt</DependsOn>
+ <LastGenOutput>qtrepc_cl.xml</LastGenOutput>
+ <SubType>Designer</SubType>
+ </T4Template>
+ <Content Include="..\qtmsbuild\repc\qtrepc_cl.xml">
+ <Link>QtMsBuild\repc\qtrepc_cl.xml</Link>
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>qtrepc_cl.xml_TT</DependentUpon>
+ <SubType>Designer</SubType>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <IncludeInVSIX>true</IncludeInVSIX>
+ </Content>
+ <T4Template Include="..\qtmsbuild\repc\qtrepc_cl.targets_TT">
+ <Link>QtMsBuild\repc\qtrepc_cl.targets_TT</Link>
+ <Generator>TextTemplatingFileGenerator</Generator>
+ <OutputFile>..\qtmsbuild\repc\qtrepc_cl.targets</OutputFile>
+ <DependsOn>$(SolutionDir)\version.targets;$(SolutionDir)\version.tt;$(SolutionDir)\common.tt</DependsOn>
+ <SubType>Designer</SubType>
+ <LastGenOutput>qtrepc_cl.targets</LastGenOutput>
+ </T4Template>
+ <Content Include="..\qtmsbuild\repc\qtrepc_cl.targets">
+ <Link>QtMsBuild\repc\qtrepc_cl.targets</Link>
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>qtrepc_cl.targets_TT</DependentUpon>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <IncludeInVSIX>true</IncludeInVSIX>
+ </Content>
<!--
///////////////////////////////////////////////////////////////////////////////////////////////
// Qt/MSBuild uic property pages and targets