CMakeLists.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. file(GLOB sources iOS/*.h iOS/*.m)
  19. firebase_ios_add_executable(firestore_objc_host_app MACOSX_BUNDLE ${sources})
  20. target_link_libraries(
  21. firestore_objc_host_app PRIVATE
  22. "-framework Foundation"
  23. "-framework UIKit"
  24. )
  25. set_target_properties(
  26. firestore_objc_host_app PROPERTIES
  27. MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/iOS/Firestore-Info.plist
  28. RESOURCE GoogleService-Info.plist
  29. )
  30. else()
  31. # Assume macOS
  32. file(GLOB sources macOS/*.h macOS/*.m)
  33. firebase_ios_add_executable(firestore_objc_host_app MACOSX_BUNDLE ${sources})
  34. target_link_libraries(
  35. firestore_objc_host_app PRIVATE
  36. "-framework AppKit"
  37. "-framework Foundation"
  38. )
  39. set_target_properties(
  40. firestore_objc_host_app PROPERTIES
  41. MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/macOS/Info.plist
  42. RESOURCE GoogleService-Info.plist
  43. )
  44. endif()