2
0

libsndfile.props 3.5 KB

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