2
0

libks.props 3.7 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. <ImportGroup Label="PropertySheets">
  4. <Import Project="libks-version.props" Condition=" '$(libksVersionImported)' == ''"/>
  5. <Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
  6. </ImportGroup>
  7. <PropertyGroup>
  8. <libksPropsImported>true</libksPropsImported>
  9. </PropertyGroup>
  10. <PropertyGroup Label="UserMacros">
  11. <libksDir>$(BaseDir)libs\libks-$(libksVersion)</libksDir>
  12. </PropertyGroup>
  13. <!--
  14. Download Target.
  15. Name must be unique.
  16. By design, targets are executed only once per project.
  17. Usage:
  18. package: URI
  19. expectfileordirectory: Skips the download and extraction if exists
  20. outputfolder: Folder to store a downloaded file.
  21. By default "$(BaseDir)libs", if empty
  22. outputfilename: If not empty, overrides filename from URI.
  23. .exe files don't get extracted
  24. extractto: Folder to extract an archive to
  25. -->
  26. <Target Name="libksBinariesDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
  27. <DownloadPackageTask
  28. package="http://files.freeswitch.org/windows/packages/libks/$(libksVersion)_$(libksBuildNumber)/libks-$(libksVersion)_$(libksBuildNumber)-binaries-$(Platform.ToLower())-$(Configuration.ToLower()).zip"
  29. expectfileordirectory="$(libksDir)\binaries\$(Platform)\$(Configuration)\ks2.dll"
  30. outputfolder=""
  31. outputfilename=""
  32. extractto="$(BaseDir)libs\"
  33. />
  34. </Target>
  35. <Target Name="libksHeadersDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
  36. <DownloadPackageTask
  37. package="http://files.freeswitch.org/windows/packages/libks/$(libksVersion)_$(libksBuildNumber)/libks-$(libksVersion)_$(libksBuildNumber)-headers.zip"
  38. expectfileordirectory="$(libksDir)\libks\src\include\libks\ks.h"
  39. outputfolder=""
  40. outputfilename=""
  41. extractto="$(BaseDir)libs\"
  42. />
  43. </Target>
  44. <Target Name="libkscopyTarget" BeforeTargets="CustomBuild" DependsOnTargets="libksBinariesDownloadTarget">
  45. <Message Text="Copying libks libraries to the freeswitch output folder." Importance="High" />
  46. <ItemGroup>
  47. <libksFiles Include="$(libksDir)\binaries\$(Platform)\$(Configuration)\*.dll"/>
  48. </ItemGroup>
  49. <Copy Condition="!exists('$(BaseDir)\$(Platform)\$(Configuration)\ks2.dll')"
  50. SourceFiles="@(libksFiles)"
  51. DestinationFiles="@(libksFiles->'$(BaseDir)\$(Platform)\$(Configuration)\%(Filename)%(Extension)')"
  52. />
  53. </Target>
  54. <ItemDefinitionGroup>
  55. <ClCompile>
  56. <AdditionalIncludeDirectories>$(libksDir)\libks\src\include;$(libksDir)\libks\src\include\libks;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  57. <PreprocessorDefinitions>__KS_FUNC__=__FUNCSIG__;WIN32;_WINDOWS;SWCLT_VERSION_MAJOR=1;SWCLT_VERSION_MINOR=0;SWCLT_VERSION_REVISION=0;_WIN32_WINNT=0x0600;_WINSOCK_DEPRECATED_NO_WARNINGS=1;WIN32_LEAN_AND_MEAN=1;KS_PLAT_WIN=1;NOMAXMIN=1;_CRT_SECURE_NO_WARNINGS=1;SWCLT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  58. </ClCompile>
  59. <Link>
  60. <AdditionalLibraryDirectories>$(libksDir)\binaries\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  61. <AdditionalDependencies>ks2.lib;%(AdditionalDependencies)</AdditionalDependencies>
  62. </Link>
  63. </ItemDefinitionGroup>
  64. </Project>