CMakeLists.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright 2019 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. if(NOT APPLE)
  15. return()
  16. endif()
  17. if(IOS)
  18. add_executable(
  19. firebase_firestore_example_app MACOSX_BUNDLE
  20. iOS/FIRAppDelegate.h
  21. iOS/FIRAppDelegate.m
  22. iOS/FIRViewController.h
  23. iOS/FIRViewController.m
  24. iOS/main.m
  25. )
  26. target_compile_options(
  27. firebase_firestore_example_app
  28. PRIVATE ${FIREBASE_IOS_OBJC_FLAGS}
  29. )
  30. target_link_libraries(
  31. firebase_firestore_example_app
  32. PRIVATE
  33. "-framework UIKit"
  34. "-framework Foundation"
  35. )
  36. set_target_properties(
  37. firebase_firestore_example_app PROPERTIES
  38. MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/iOS/Firestore-Info.plist
  39. RESOURCE GoogleService-Info.plist
  40. )
  41. else()
  42. # Assume macOS
  43. add_executable(
  44. firebase_firestore_example_app MACOSX_BUNDLE
  45. macOS/AppDelegate.h
  46. macOS/AppDelegate.m
  47. macOS/main.m
  48. )
  49. target_compile_options(
  50. firebase_firestore_example_app
  51. PRIVATE ${FIREBASE_IOS_OBJC_FLAGS}
  52. )
  53. target_link_libraries(
  54. firebase_firestore_example_app
  55. PRIVATE
  56. "-framework AppKit"
  57. "-framework Foundation"
  58. )
  59. set_target_properties(
  60. firebase_firestore_example_app PROPERTIES
  61. MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/macOS/Info.plist
  62. RESOURCE GoogleService-Info.plist
  63. )
  64. endif()