2
0

openssl.props 3.8 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="openssl-version.props" Condition=" '$(OpenSSLVersionImported)' == ''"/>
  5. <Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
  6. </ImportGroup>
  7. <PropertyGroup>
  8. <OpensslPropsImported>true</OpensslPropsImported>
  9. </PropertyGroup>
  10. <PropertyGroup>
  11. <LibraryConfiguration Condition="$(Configuration.ToLower().Contains('debug'))">Debug</LibraryConfiguration>
  12. <LibraryConfiguration Condition="$(Configuration.ToLower().Contains('release'))">Release</LibraryConfiguration>
  13. </PropertyGroup>
  14. <!--
  15. Download Target.
  16. Name must be unique.
  17. By design, targets are executed only once per project.
  18. Usage:
  19. package: URI
  20. expectfileordirectory: Skips the download and extraction if exists
  21. outputfolder: Folder to store a downloaded file.
  22. By default "$(BaseDir)libs", if empty
  23. outputfilename: If not empty, overrides filename from URI.
  24. .exe files don't get extracted
  25. extractto: Folder to extract an archive to
  26. -->
  27. <Target Name="opensslbinariesTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
  28. <DownloadPackageTask
  29. package="http://files.freeswitch.org/windows/packages/openssl/$(OpenSSLVersion)/openssl-$(OpenSSLVersion)-binaries-$(Platform.ToLower())-$(LibraryConfiguration.ToLower()).zip"
  30. expectfileordirectory="$(OpenSSLLibDir)\binaries\$(Platform)\$(LibraryConfiguration)\openssl.exe"
  31. outputfolder=""
  32. outputfilename=""
  33. extractto="$(BaseDir)libs"
  34. />
  35. </Target>
  36. <Target Name="opensslheadersTarget" BeforeTargets="CustomBuild" DependsOnTargets="opensslbinariesTarget">
  37. <DownloadPackageTask
  38. package="http://files.freeswitch.org/windows/packages/openssl/$(OpenSSLVersion)/openssl-$(OpenSSLVersion)-headers.zip"
  39. expectfileordirectory="$(OpenSSLLibDir)\include\openssl\ssl.h"
  40. outputfolder=""
  41. outputfilename=""
  42. extractto="$(BaseDir)libs"
  43. />
  44. </Target>
  45. <Target Name="opensslcopyTarget" BeforeTargets="CustomBuild" DependsOnTargets="opensslbinariesTarget">
  46. <ItemGroup>
  47. <opensslFiles Include="$(OpenSSLLibDir)\binaries\$(Platform)\$(LibraryConfiguration)\*.*"/>
  48. </ItemGroup>
  49. <Copy Condition="!exists('$(BaseDir)\$(Platform)\$(LibraryConfiguration)\openssl.exe')"
  50. SourceFiles="@(opensslFiles)"
  51. DestinationFiles="@(opensslFiles->'$(BaseDir)\$(Platform)\$(LibraryConfiguration)\%(Filename)%(Extension)')"
  52. />
  53. </Target>
  54. <ItemDefinitionGroup>
  55. <ClCompile>
  56. <AdditionalIncludeDirectories>$(OpenSSLLibDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  57. <AdditionalIncludeDirectories Condition="'$(Platform)'=='Win32'">$(OpenSSLLibDir)\include_x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  58. <AdditionalIncludeDirectories Condition="'$(Platform)'=='x64'">$(OpenSSLLibDir)\include_x64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  59. <PreprocessorDefinitions>HAVE_LIBCRYPTO;OPENSSL;HAVE_OPENSSL;HAVE_OPENSSL_DTLS_SRTP;HAVE_OPENSSL_DTLS;HAVE_OPENSSL_DTLSv1_2_method;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  60. </ClCompile>
  61. <Link>
  62. <AdditionalLibraryDirectories>$(OpenSSLLibDir)\binaries\$(Platform)\$(LibraryConfiguration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  63. <AdditionalDependencies>ws2_32.lib;crypt32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
  64. </Link>
  65. </ItemDefinitionGroup>
  66. </Project>