summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-08-20 16:18:28 +0800
committerOpportunityLiu <[email protected]>2019-08-20 16:18:28 +0800
commitb515795919b7eb114032a441564512645fae489c (patch)
tree9a63e0eb36f1543e6c55b9d0bf610eedb1238eb9
parent608b445820aae978801e06cd0e6695962163dc72 (diff)
resolve path for whole project
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.Defaults.props20
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj1
2 files changed, 21 insertions, 0 deletions
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.Defaults.props b/xmake/plugins/project/vsxmake/vsproj/Xmake.Defaults.props
new file mode 100644
index 000000000..df0b5f9e5
--- /dev/null
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.Defaults.props
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <PropertyGroup Label="XmakePathsResolve">
+ <XmakeProgramDirResolved>$(XmakeProgramDir)</XmakeProgramDirResolved>
+ <XmakeProjectDirResolved>$(XmakeProjectDir)</XmakeProjectDirResolved>
+ <XmakeScriptDirResolved>$(XmakeScriptDir)</XmakeScriptDirResolved>
+
+ <!-- resolve if they are relative paths -->
+ <XmakeProjectDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeProjectDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeProjectDirResolved)'))</XmakeProjectDirResolved>
+ <XmakeScriptDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeScriptDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeScriptDirResolved)'))</XmakeScriptDirResolved>
+ <XmakeBuilDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeBuilDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeBuilDirResolved)'))</XmakeBuilDirResolved>
+
+ <!-- normalize paths -->
+ <XmakeProgramDir>$([System.IO.Path]::GetFullPath('$(XmakeProgramDirResolved)'))</XmakeProgramDir>
+ <XmakeProjectDir>$([System.IO.Path]::GetFullPath('$(XmakeProjectDirResolved)'))</XmakeProjectDir>
+ <XmakeScriptDir>$([System.IO.Path]::GetFullPath('$(XmakeScriptDirResolved)'))</XmakeScriptDir>
+ </PropertyGroup>
+
+</Project>
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj
index 8df23001e..cb47d68db 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj
@@ -25,6 +25,7 @@
<XmakeProjectFile>#projectfile#</XmakeProjectFile>
<XmakeTarget>#target#</XmakeTarget>
</PropertyGroup>
+ <Import Project="$(XmakeProgramDir)\plugins\project\vsxmake\vsproj\xmake.Defaults.props" />
#Import(XmakeConfig)#
#Import(XmakePath)#
<Import Project="$(XmakeProgramDir)\plugins\project\vsxmake\vsproj\xmake.props" />