protobuf.cmake 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 protobuf)
  16. return()
  17. endif()
  18. # This ExternalProject unpacks itself inside the gRPC source tree. CMake clears
  19. # the SOURCE_DIR when unpacking so this must come after grpc despite the fact
  20. # that grpc logically depends upon this.
  21. set(version 3.9.2)
  22. ExternalProject_Add(
  23. protobuf
  24. DEPENDS
  25. grpc-download
  26. DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
  27. DOWNLOAD_NAME protobuf-${version}.tar.gz
  28. URL https://github.com/google/protobuf/archive/v${version}.tar.gz
  29. URL_HASH SHA256=1fbf1c2962af287607232b2eddeaec9b4f4a7a6f5934e1a9276e9af76952f7e0
  30. PREFIX ${PROJECT_BINARY_DIR}
  31. SOURCE_DIR ${PROJECT_BINARY_DIR}/src/grpc/third_party/protobuf
  32. CONFIGURE_COMMAND ""
  33. BUILD_COMMAND ""
  34. INSTALL_COMMAND ""
  35. TEST_COMMAND ""
  36. )