mariadb-connector-c.props 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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="mariadb-connector-c-version.props" Condition=" '$(mariadb-connector-cVersionImported)' == '' "/>
  5. <Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
  6. </ImportGroup>
  7. <PropertyGroup>
  8. <mariadb-connector-cPropsImported>true</mariadb-connector-cPropsImported>
  9. </PropertyGroup>
  10. <PropertyGroup Label="UserMacros">
  11. <mariadb-connector-clibDir>$(BaseDir)libs\mariadb-connector-c-$(mariadb-connector-cVersion)</mariadb-connector-clibDir>
  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="mariadb-connector-cBinariesDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
  27. <DownloadPackageTask
  28. package="http://files.freeswitch.org/windows/packages/mariadb-connector-c/$(mariadb-connector-cVersion)/mariadb-connector-c-$(mariadb-connector-cVersion)-binaries-$(Platform.ToLower())-$(Configuration.ToLower()).zip"
  29. expectfileordirectory="$(mariadb-connector-clibDir)\binaries\$(Platform)\$(Configuration)\libmariadb.dll"
  30. outputfolder=""
  31. outputfilename=""
  32. extractto="$(BaseDir)libs\"
  33. />
  34. </Target>
  35. <Target Name="mariadb-connector-cHeadersDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
  36. <DownloadPackageTask
  37. package="http://files.freeswitch.org/windows/packages/mariadb-connector-c/$(mariadb-connector-cVersion)/mariadb-connector-c-$(mariadb-connector-cVersion)-headers.zip"
  38. expectfileordirectory="$(mariadb-connector-clibDir)\include\mysql.h"
  39. outputfolder=""
  40. outputfilename=""
  41. extractto="$(BaseDir)libs\"
  42. />
  43. </Target>
  44. <Target Name="mariadb-connector-ccopyTarget" AfterTargets="Build" DependsOnTargets="Build">
  45. <ItemGroup>
  46. <mariadb-connector-cFiles Include="$(mariadb-connector-clibDir)\binaries\$(Platform)\$(Configuration)\*.dll"/>
  47. <libmariadb-plugins Include="$(mariadb-connector-clibDir)\binaries\$(Platform)\$(Configuration)\plugin\*.*" />
  48. </ItemGroup>
  49. <Copy Condition="!exists('$(BaseDir)\$(Platform)\$(Configuration)\libmariadb.dll')"
  50. SourceFiles="@(mariadb-connector-cFiles)"
  51. DestinationFiles="@(mariadb-connector-cFiles->'$(BaseDir)\$(Platform)\$(Configuration)\%(Filename)%(Extension)')"
  52. />
  53. <Copy Condition="!exists('$(BaseDir)\$(Platform)\$(Configuration)\plugin\caching_sha2_password.dll')"
  54. SourceFiles="@(libmariadb-plugins)"
  55. DestinationFolder="$(BaseDir)\$(Platform)\$(Configuration)\libmariadb_plugin\"
  56. />
  57. </Target>
  58. <ItemDefinitionGroup>
  59. <ClCompile>
  60. <AdditionalIncludeDirectories>$(mariadb-connector-clibDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  61. </ClCompile>
  62. <Link>
  63. <AdditionalLibraryDirectories>$(mariadb-connector-clibDir)\binaries\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  64. <AdditionalDependencies>libmariadb.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
  65. </Link>
  66. </ItemDefinitionGroup>
  67. </Project>