freeswitch/w32/zlib.props

81 lines
3.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<zlibImported>true</zlibImported>
</PropertyGroup>
<ImportGroup Label="PropertySheets">
<Import Project="zlib-version.props" Condition=" '$(zlibVersionImported)' == '' "/>
<Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
</ImportGroup>
<PropertyGroup>
<LibraryConfiguration Condition="$(Configuration.ToLower().Contains('debug'))">Debug</LibraryConfiguration>
<LibraryConfiguration Condition="$(Configuration.ToLower().Contains('release'))">Release</LibraryConfiguration>
<LibraryFileName Condition=" '$(LibraryConfiguration)' == 'Debug' ">zlibd</LibraryFileName>
<LibraryFileName Condition=" '$(LibraryConfiguration)' == 'Release' ">zlib</LibraryFileName>
</PropertyGroup>
<PropertyGroup Label="UserMacros">
<zlibLibDir>$(BaseDir)libs\zlib-$(zlibVersion)</zlibLibDir>
</PropertyGroup>
<!--
Download Target.
Name must be unique.
By design, targets are executed only once per project.
Usage:
package: URI
expectfileordirectory: Skips the download and extraction if exists
outputfolder: Folder to store a downloaded file.
By default "$(BaseDir)libs", if empty
outputfilename: If not empty, overrides filename from URI.
.exe files don't get extracted
extractto: Folder to extract an archive to
-->
<Target Name="zlibBinariesDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
<DownloadPackageTask
package="http://files.freeswitch.org/windows/packages/zlib/$(zlibVersion)/zlib-$(zlibVersion)-binaries-$(Platform.ToLower())-$(LibraryConfiguration.ToLower()).zip"
expectfileordirectory="$(zlibLibDir)\binaries\$(Platform)\$(LibraryConfiguration)\lib\$(LibraryFileName).lib"
outputfolder=""
outputfilename=""
extractto="$(BaseDir)libs\"
/>
</Target>
<Target Name="zlibHeadersDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
<DownloadPackageTask
package="http://files.freeswitch.org/windows/packages/zlib/$(zlibVersion)/zlib-$(zlibVersion)-headers.zip"
expectfileordirectory="$(zlibLibDir)\include\zlib.h"
outputfolder=""
outputfilename=""
extractto="$(BaseDir)libs\"
/>
</Target>
<Target Name="zlibcopyTarget" BeforeTargets="CustomBuild" DependsOnTargets="zlibBinariesDownloadTarget">
<ItemGroup>
<zlibFiles Include="$(zlibLibDir)\binaries\$(Platform)\$(LibraryConfiguration)\bin\*.dll" />
</ItemGroup>
<Copy Condition="!exists('$(BaseDir)$(Platform)\$(LibraryConfiguration)\$(LibraryFileName).dll')"
SourceFiles="@(zlibFiles)"
DestinationFiles="@(zlibFiles->'$(BaseDir)$(Platform)\$(LibraryConfiguration)\%(Filename)%(Extension)')"
/>
</Target>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)libs\zlib-$(zlibVersion)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_ZLIB;ZLIB_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(SolutionDir)libs\zlib-$(zlibVersion)\binaries\$(Platform)\$(LibraryConfiguration)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>$(LibraryFileName).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
</Project>