zlib.cmake 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright 2018 Google LLC
  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. set(version 1.2.11)
  25. ExternalProject_Add(
  26. zlib
  27. DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
  28. DOWNLOAD_NAME zlib-v${version}.tar.gz
  29. URL https://github.com/madler/zlib/archive/v${version}.tar.gz
  30. URL_HASH SHA256=629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff
  31. PREFIX ${PROJECT_BINARY_DIR}
  32. SOURCE_DIR ${PROJECT_BINARY_DIR}/src/zlib
  33. CONFIGURE_COMMAND ""
  34. BUILD_COMMAND ""
  35. INSTALL_COMMAND ""
  36. TEST_COMMAND ""
  37. )