2
0

lua.props 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3. <ImportGroup Label="PropertySheets">
  4. <Import Project="lua-version.props" Condition=" '$(LuaVersionImported)' == '' "/>
  5. <Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
  6. </ImportGroup>
  7. <PropertyGroup Label="UserMacros">
  8. <LuaLibDir>$(SolutionDir)libs\lua-$(LuaVersion)</LuaLibDir>
  9. </PropertyGroup>
  10. <!--
  11. Download Target.
  12. Name must be unique.
  13. By design, targets are executed only once per project.
  14. Usage:
  15. package: URI
  16. expectfileordirectory: Skips the download and extraction if exists
  17. outputfolder: Folder to store a downloaded file.
  18. By default "$(BaseDir)libs", if empty
  19. outputfilename: If not empty, overrides filename from URI.
  20. .exe files don't get extracted
  21. extractto: Folder to extract an archive to
  22. -->
  23. <Target Name="luaBinariesDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
  24. <DownloadPackageTask
  25. package="http://files.freeswitch.org/windows/packages/lua/$(luaVersion)/lua-$(luaVersion)-binaries-$(Platform.ToLower())-$(Configuration.ToLower()).zip"
  26. expectfileordirectory="$(LuaLibDir)\binaries\$(Platform)\$(Configuration)\lua53.dll"
  27. outputfolder=""
  28. outputfilename=""
  29. extractto="$(BaseDir)libs\"
  30. />
  31. </Target>
  32. <Target Name="luaHeadersDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
  33. <DownloadPackageTask
  34. package="http://files.freeswitch.org/windows/packages/lua/$(luaVersion)/lua-$(luaVersion)-headers.zip"
  35. expectfileordirectory="$(LuaLibDir)\include\lua.h"
  36. outputfolder=""
  37. outputfilename=""
  38. extractto="$(BaseDir)libs\"
  39. />
  40. </Target>
  41. <Target Name="luacopyTarget" BeforeTargets="CustomBuild" DependsOnTargets="luaBinariesDownloadTarget">
  42. <Message Text="Copying lua libraries to the freeswitch output folder." Importance="High" />
  43. <ItemGroup>
  44. <luaFiles Include="$(LuaLibDir)\binaries\$(Platform)\$(Configuration)\*.dll"/>
  45. </ItemGroup>
  46. <Copy Condition="!exists('$(BaseDir)\$(Platform)\$(Configuration)\lua53.dll')"
  47. SourceFiles="@(luaFiles)"
  48. DestinationFiles="@(luaFiles->'$(BaseDir)\$(Platform)\$(Configuration)\%(Filename)%(Extension)')"
  49. />
  50. </Target>
  51. <ItemDefinitionGroup>
  52. <ClCompile>
  53. <AdditionalIncludeDirectories>$(LuaLibDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  54. </ClCompile>
  55. <Link>
  56. <AdditionalLibraryDirectories>$(LuaLibDir)\binaries\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  57. <AdditionalDependencies>lua53.lib;%(AdditionalDependencies)</AdditionalDependencies>
  58. </Link>
  59. </ItemDefinitionGroup>
  60. </Project>