podspec_rules.cmake 1.3 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(CMakeParseArguments)
  15. macro(podspec_version VARIABLE PODSPEC_FILE)
  16. execute_process(
  17. COMMAND
  18. sed -n
  19. -f ${PROJECT_SOURCE_DIR}/cmake/podspec_version.sed
  20. ${PODSPEC_FILE}
  21. OUTPUT_VARIABLE ${VARIABLE}
  22. OUTPUT_STRIP_TRAILING_WHITESPACE
  23. )
  24. endmacro()
  25. macro(firebase_version VARIABLE PODSPEC_FILE)
  26. execute_process(
  27. COMMAND
  28. sed -n
  29. -f ${PROJECT_SOURCE_DIR}/cmake/firebase_version.sed
  30. ${PODSPEC_FILE}
  31. OUTPUT_VARIABLE ${VARIABLE}
  32. OUTPUT_STRIP_TRAILING_WHITESPACE
  33. )
  34. endmacro()
  35. function(podspec_prep_headers FRAMEWORK_NAME)
  36. file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Headers/${FRAMEWORK_NAME})
  37. execute_process(
  38. COMMAND
  39. ln -sf ${ARGN} ${PROJECT_BINARY_DIR}/Headers/${FRAMEWORK_NAME}
  40. )
  41. endfunction()