From c182b06ae34e91838261e391f5f1d3daa2d9293e Mon Sep 17 00:00:00 2001 From: Miguel Costa Date: Tue, 5 Feb 2019 11:20:28 +0100 Subject: Use relative paths for output of Qt tools If the output of a Qt tool is given as an absolute path, this will now be converted during build to a path relative to the project directory This allows the use of %(RelativeDir) when referencing Qt outputs. Task-number: QTVSADDINBUG-611 Change-Id: I9643200ac43fe19b9908d06d100d59237ecc7a4e Reviewed-by: Oliver Wolff --- src/qtmsbuild/qtmoc.targets | 14 ++++++++++++-- src/qtmsbuild/qtqml.targets | 19 +++++++++++++++---- src/qtmsbuild/qtrcc.targets | 7 ++++++- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/qtmsbuild/qtmoc.targets b/src/qtmsbuild/qtmoc.targets index 5c6a6f1a..9a64267a 100644 --- a/src/qtmsbuild/qtmoc.targets +++ b/src/qtmsbuild/qtmoc.targets @@ -309,6 +309,14 @@ AND ('%(QtMoc.ParallelProcess)' != 'true' OR '$(SelectedFiles)' != '')" >true + + + $([MSBuild]::MakeRelative($(ProjectDir), %(QtMoc.OutputFile)).TrimStart('\')) + + + $([MSBuild]::MakeRelative($(ProjectDir), %(QtMoc.InputFile)).TrimStart('\')) - %(QtMoc.OutputFile) - %(QtMoc.InputFile) + $(output_relative) + $(input_relative) @@ -343,6 +351,8 @@ + + diff --git a/src/qtmsbuild/qtqml.targets b/src/qtmsbuild/qtqml.targets index 94d36cf7..140c2bf2 100644 --- a/src/qtmsbuild/qtqml.targets +++ b/src/qtmsbuild/qtqml.targets @@ -263,7 +263,7 @@ $([MSBuild]::MakeRelative($(MSBuildProjectDirectory),$(full_path))) +>$([MSBuild]::MakeRelative($(MSBuildProjectDirectory),$(full_path)).TrimStart('\')) @@ -414,6 +414,11 @@ @(loader_input->'%(DependenciesChanged)') @(loader_input->'%(InputChanged)') @(loader_input->'%(IsSelected)') + + + @(loader->'%(QmlCacheLoaderFile)') + $([MSBuild]::MakeRelative($(ProjectDir), $(cache_loader_path)).TrimStart('\')) + $([MSBuild]::MakeRelative($(ProjectDir), %(QtQml.OutputFile)).TrimStart('\')) + $([MSBuild]::MakeRelative($(ProjectDir), %(QtRcc.OutputFile)).TrimStart('\')) - %(QtRcc.OutputFile) + $(output_relative) NotUsing @@ -357,6 +361,7 @@ + -- cgit v1.2.3