zlib.cmake 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright 2018 Google
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. include(ExternalProject)
  15. if(TARGET zlib)
  16. return()
  17. endif()
  18. # Use a system- or user-supplied zlib if available
  19. find_package(ZLIB)
  20. if(ZLIB_FOUND)
  21. add_custom_target(zlib)
  22. return()
  23. endif()
  24. ExternalProject_Add(
  25. zlib
  26. DEPENDS
  27. grpc-download
  28. DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
  29. DOWNLOAD_NAME zlib-v1.2.11.tar.gz
  30. URL https://github.com/madler/zlib/archive/v1.2.11.tar.gz
  31. URL_HASH SHA256=629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff
  32. PREFIX ${PROJECT_BINARY_DIR}
  33. SOURCE_DIR ${PROJECT_BINARY_DIR}/src/grpc/third_party/zlib
  34. CONFIGURE_COMMAND ""
  35. BUILD_COMMAND ""
  36. INSTALL_COMMAND ""
  37. TEST_COMMAND ""
  38. )