aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Costa <miguel.costa@qt.io>2019-09-26 17:21:04 +0200
committerMiguel Costa <miguel.costa@qt.io>2019-10-01 13:55:21 +0000
commitd798e760d39452c4af9ea704a4ed6fac35936a69 (patch)
tree12fba7643c99cb7b74c2cf979b99398edd6a7683
parentb30c3a11a5547c4f79239c27057f00ba281efca5 (diff)
Allow additional Qt include paths
The Qt Settings property page will now allow specifying a list of directory paths to add to the header search. These can be either absolute paths or relative to the Qt installation. This change also fixes issues related to the property where additional Qt module libs can be specified. Change-Id: Ide14e53c05510025b89b6edc011af2d1cbda5f39 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--src/qtmsbuild/qt_settings.xml4
-rw-r--r--src/qtmsbuild/qt_settings_vs2015.xml4
-rw-r--r--src/qtmsbuild/qt_vars.targets32
3 files changed, 33 insertions, 7 deletions
diff --git a/src/qtmsbuild/qt_settings.xml b/src/qtmsbuild/qt_settings.xml
index ec5c84a8..8f089931 100644
--- a/src/qtmsbuild/qt_settings.xml
+++ b/src/qtmsbuild/qt_settings.xml
@@ -87,6 +87,10 @@
Description=
"Path to folder containing executable files of Qt modules. When a non-rooted path is specified, it will be considered relative to the Qt installation directory."/>
<StringListProperty
+ Name="QtHeaderSearchPath"
+ Category="QtSettings_02_Paths"
+ DisplayName="Additional Qt header search paths" />
+ <StringListProperty
Name="QtLibrarySearchPath"
Category="QtSettings_02_Paths"
DisplayName="Additional Qt library search paths" />
diff --git a/src/qtmsbuild/qt_settings_vs2015.xml b/src/qtmsbuild/qt_settings_vs2015.xml
index 2e19da50..177db743 100644
--- a/src/qtmsbuild/qt_settings_vs2015.xml
+++ b/src/qtmsbuild/qt_settings_vs2015.xml
@@ -90,6 +90,10 @@
Description=
"Path to folder containing executable files of Qt modules. When a non-rooted path is specified, it will be considered relative to the Qt installation directory."/>
<StringListProperty
+ Name="QtHeaderSearchPath"
+ Category="QtSettings_02_Paths"
+ DisplayName="Additional Qt header search paths" />
+ <StringListProperty
Name="QtLibrarySearchPath"
Category="QtSettings_02_Paths"
DisplayName="Additional Qt library search paths" />
diff --git a/src/qtmsbuild/qt_vars.targets b/src/qtmsbuild/qt_vars.targets
index bb889679..361bf117 100644
--- a/src/qtmsbuild/qt_vars.targets
+++ b/src/qtmsbuild/qt_vars.targets
@@ -42,7 +42,8 @@
<QtVariableList Include="$(QtVariables)"/>
<QMakeCodeLine Include="$(QMakeCodeLines)"/>
<QtVarProp Include="@(QtVariableList->'Qt_%(Identity)_')"/>
- <QtLibsList Include="$(QtLibrarySearchPath)"></QtLibsList>
+ <QtIncludesList Include="$(QtHeaderSearchPath)"/>
+ <QtLibsList Include="$(QtLibrarySearchPath)"/>
</ItemGroup>
<PropertyGroup>
@@ -93,12 +94,22 @@
<Output TaskParameter="ValueSetByTask" PropertyName="QtToolsPath" />
</CreateProperty>
+ <!--// Generate INCLUDEPATH value -->
<ItemGroup>
- <QtLinkInput Include=
+ <QtIncludes Include=
+"$([System.IO.Path]::Combine($(QtInstallDir),$([System.String]::Copy('%(QtIncludesList.Identity)'))))"/>
+ </ItemGroup>
+ <PropertyGroup>
+ <QtIncludes>@(QtIncludes->'&quot;%(Identity)&quot;', ' ')</QtIncludes>
+ </PropertyGroup>
+
+ <!--// Generate LIBS value -->
+ <ItemGroup>
+ <QtLibs Include=
"$([System.IO.Path]::Combine($(QtInstallDir),$([System.String]::Copy('%(QtLibsList.Identity)'))))"/>
</ItemGroup>
<PropertyGroup>
- <QtLibs>@(QtLinkInput->'-L%(Identity)', ' ')</QtLibs>
+ <QtLibs>@(QtLibs->'&quot;-L%(Identity)&quot;', ' ')</QtLibs>
</PropertyGroup>
<Message
@@ -134,10 +145,17 @@
# Custom additional .pro file code (from property page) -->
@(QMakeCodeLine->'%(Identity)','%0D%0A')
</QtVarsProFileInput>
-
- <QtVarsProFileInput Condition="'$(QtLibrarySearchPath)'!=''">
+ <!--
+# Custom additional header search paths (from property page) -->
+ <QtVarsProFileInput Condition="'$(QtHeaderSearchPath)' != ''">
+ $(QtVarsProFileInput)
+ INCLUDEPATH += $(QtIncludes)
+ </QtVarsProFileInput>
+ <!--
+# Custom additional library search paths (from property page) -->
+ <QtVarsProFileInput Condition="'$(QtLibrarySearchPath)' != ''">
$(QtVarsProFileInput)
- LIBS = $(QtLibs)
+ LIBS += $(QtLibs)
</QtVarsProFileInput>
<!--// Generate .pro file -->
@@ -166,7 +184,7 @@ defineReplace(formatMsBuildString) {
## Fetch information from required modules through dependency relation
#
defined(modules, var) {
- INCLUDEPATH = $$[INCLUDEPATH]
+ INCLUDEPATH += $$[INCLUDEPATH]
QT = $$resolve_depends(modules, "QT.")
for (module, $$list($${QT})) {
INCLUDEPATH *= $$eval($$"QT.$${module}.includes")