2
0

libpq.props 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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="libpq-version.props" Condition=" '$(libpqVersionImported)' == '' "/>
  5. <Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
  6. </ImportGroup>
  7. <PropertyGroup>
  8. <libpqPropsImported>true</libpqPropsImported>
  9. </PropertyGroup>
  10. <PropertyGroup Label="UserMacros">
  11. <libpqlibDir>$(BaseDir)libs\libpq-$(libpqVersion)</libpqlibDir>
  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="libpqBinariesDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
  27. <DownloadPackageTask
  28. package="http://files.freeswitch.org/windows/packages/libpq/$(libpqVersion)/libpq-$(libpqVersion)-binaries-$(Platform.ToLower())-$(Configuration.ToLower()).zip"
  29. expectfileordirectory="$(libpqlibDir)\binaries\$(Platform)\$(Configuration)\libpq.dll"
  30. outputfolder=""
  31. outputfilename=""
  32. extractto="$(BaseDir)libs\"
  33. />
  34. </Target>
  35. <Target Name="libpqHeadersDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
  36. <DownloadPackageTask
  37. package="http://files.freeswitch.org/windows/packages/libpq/$(libpqVersion)/libpq-$(libpqVersion)-headers.zip"
  38. expectfileordirectory="$(libpqlibDir)\include\libpq-fe.h"
  39. outputfolder=""
  40. outputfilename=""
  41. extractto="$(BaseDir)libs\"
  42. />
  43. </Target>
  44. <Target Name="libpqcopyTarget" AfterTargets="Build" DependsOnTargets="Build">
  45. <ItemGroup>
  46. <libpqFiles Include="$(libpqlibDir)\binaries\$(Platform)\$(Configuration)\*.dll"/>
  47. </ItemGroup>
  48. <Copy Condition="!exists('$(BaseDir)\$(Platform)\$(Configuration)\libpq.dll')"
  49. SourceFiles="@(libpqFiles)"
  50. DestinationFiles="@(libpqFiles->'$(BaseDir)\$(Platform)\$(Configuration)\%(Filename)%(Extension)')"
  51. />
  52. </Target>
  53. <ItemDefinitionGroup>
  54. <ClCompile>
  55. <AdditionalIncludeDirectories>$(libpqlibDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  56. <PreprocessorDefinitions>SWITCH_HAVE_PGSQL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  57. </ClCompile>
  58. <Link>
  59. <AdditionalLibraryDirectories>$(libpqlibDir)\binaries\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  60. <AdditionalDependencies>libpq.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
  61. </Link>
  62. </ItemDefinitionGroup>
  63. </Project>