diff options
author | Miguel Costa <miguel.costa@qt.io> | 2019-02-05 11:20:28 +0100 |
---|---|---|
committer | Miguel Costa <miguel.costa@qt.io> | 2019-02-08 13:13:30 +0000 |
commit | c182b06ae34e91838261e391f5f1d3daa2d9293e (patch) | |
tree | beb567ed6852ab1aaf0feb85776bf0611a0104ab | |
parent | 31cf36b0543c32b186ff54df908c4dd7abbbe228 (diff) |
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 <oliver.wolff@qt.io>
-rw-r--r-- | src/qtmsbuild/qtmoc.targets | 14 | ||||
-rw-r--r-- | src/qtmsbuild/qtqml.targets | 19 | ||||
-rw-r--r-- | 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</run_single> + + <!--// Get relative path to output --> + <output_relative +>$([MSBuild]::MakeRelative($(ProjectDir), %(QtMoc.OutputFile)).TrimStart('\'))</output_relative> + + <!--// Get relative path to input --> + <input_relative +>$([MSBuild]::MakeRelative($(ProjectDir), %(QtMoc.InputFile)).TrimStart('\'))</input_relative> </PropertyGroup> <!-- @@ -328,8 +336,8 @@ <!-- /////////////////////////////////////////////////////////////////////////////////////////// // C++ dynamic source --> - <ClCompile Condition="'%(QtMoc.DynamicSource)' == 'output'">%(QtMoc.OutputFile)</ClCompile> - <ClCompile Condition="'%(QtMoc.DynamicSource)' == 'input'">%(QtMoc.InputFile)</ClCompile> + <ClCompile Condition="'%(QtMoc.DynamicSource)' == 'output'">$(output_relative)</ClCompile> + <ClCompile Condition="'%(QtMoc.DynamicSource)' == 'input'">$(input_relative)</ClCompile> </QtWork> </ItemGroup> @@ -343,6 +351,8 @@ <input_changed/> <run_parallel/> <run_single/> + <output_relative/> + <input_relative/> </PropertyGroup> <ItemGroup> <moc_InputFile Remove="@(moc_InputFile)"/> 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 @@ <!-- // $(relative_path) ::= path of filtered file, relative to project directory --> <relative_path Condition="'%(QtRccFilter.QtQml)' != ''" ->$([MSBuild]::MakeRelative($(MSBuildProjectDirectory),$(full_path)))</relative_path> +>$([MSBuild]::MakeRelative($(MSBuildProjectDirectory),$(full_path)).TrimStart('\'))</relative_path> <!-- // $(run_parallel) ::= run qmlcachegen in a parallel process // $(run_single) ::= run qmlcachegen in single process mode --> @@ -414,6 +414,11 @@ <dependencies_changed>@(loader_input->'%(DependenciesChanged)')</dependencies_changed> <input_changed>@(loader_input->'%(InputChanged)')</input_changed> <is_selected>@(loader_input->'%(IsSelected)')</is_selected> + + <!--// Get relative path to output --> + <cache_loader_path>@(loader->'%(QmlCacheLoaderFile)')</cache_loader_path> + <output_relative +>$([MSBuild]::MakeRelative($(ProjectDir), $(cache_loader_path)).TrimStart('\'))</output_relative> </PropertyGroup> <ItemGroup> <!-- @@ -432,8 +437,7 @@ <DisableLog>true</DisableLog> <DependenciesChanged>$(dependencies_changed.Contains('true'))</DependenciesChanged> <InputChanged>$(input_changed.Contains('true'))</InputChanged> - <ClCompile Condition="'%(loader.DynamicSource)' != 'false'" - >@(loader->'%(QmlCacheLoaderFile)')</ClCompile> + <ClCompile Condition="'%(loader.DynamicSource)' != 'false'">$(output_relative)</ClCompile> <DependsOn>@(loader_input->'%(Inputs)')</DependsOn> </QtWork> </ItemGroup> @@ -454,6 +458,8 @@ <run_single/> <dependencies_changed/> <input_changed/> + <cache_loader_path/> + <output_relative/> </PropertyGroup> </Target> @@ -535,6 +541,10 @@ <run_single Condition="'@(QtQml)' != '' AND ('%(QtQml.ParallelProcess)' != 'true' OR '$(SelectedFiles)' != '')" >true</run_single> + + <!--// Get relative path to output --> + <output_relative +>$([MSBuild]::MakeRelative($(ProjectDir), %(QtQml.OutputFile)).TrimStart('\'))</output_relative> </PropertyGroup> <ItemGroup> <!-- @@ -550,7 +560,7 @@ <DependenciesChanged>$(dependencies_changed)</DependenciesChanged> <ParallelBuild Condition="'$(run_parallel)' == 'true'">true</ParallelBuild> <ParallelBuild Condition="'$(run_single)' == 'true'">false</ParallelBuild> - <ClCompile Condition="'%(QtQml.DynamicSource)' != 'false'">%(QtQml.OutputFile)</ClCompile> + <ClCompile Condition="'%(QtQml.DynamicSource)' != 'false'">$(output_relative)</ClCompile> </QtWork> </ItemGroup> @@ -563,6 +573,7 @@ <options/> <run_parallel/> <run_single/> + <output_relative/> </PropertyGroup> </Target> diff --git a/src/qtmsbuild/qtrcc.targets b/src/qtmsbuild/qtrcc.targets index 0d95d1ac..71358cba 100644 --- a/src/qtmsbuild/qtrcc.targets +++ b/src/qtmsbuild/qtrcc.targets @@ -323,6 +323,10 @@ AND ('%(QtRcc.ParallelProcess)' != 'true' OR '$(SelectedFiles)' != '')" >true</run_single> + + <!--// Get relative path to output --> + <output_relative +>$([MSBuild]::MakeRelative($(ProjectDir), %(QtRcc.OutputFile)).TrimStart('\'))</output_relative> </PropertyGroup> <!-- @@ -342,7 +346,7 @@ <!-- /////////////////////////////////////////////////////////////////////////////////////////// // C++ dynamic source --> - <ClCompile Condition="'%(QtRcc.DynamicSource)' == 'output'">%(QtRcc.OutputFile)</ClCompile> + <ClCompile Condition="'%(QtRcc.DynamicSource)' == 'output'">$(output_relative)</ClCompile> <PrecompiledHeader>NotUsing</PrecompiledHeader> </QtWork> </ItemGroup> @@ -357,6 +361,7 @@ <input_changed/> <run_parallel/> <run_single/> + <output_relative/> </PropertyGroup> <ItemGroup> <rcc_InputFile Remove="@(rcc_InputFile)"/> |