launcher_project_ios.cmake 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. set(LY_LINK_OPTIONS
  9. PRIVATE
  10. -ObjC
  11. )
  12. # Add resources and app icons to launchers
  13. list(APPEND candidate_paths ${project_real_path}/Resources/Platform/iOS)
  14. list(APPEND candidate_paths ${project_real_path}/Gem/Resources/Platform/iOS) # Legacy projects
  15. list(APPEND candidate_paths ${project_real_path}/Gem/Resources/IOSLauncher) # Legacy projects
  16. foreach(resource_path IN LISTS candidate_paths)
  17. if(EXISTS ${resource_path})
  18. set(ly_game_resource_folder ${resource_path})
  19. break()
  20. endif()
  21. endforeach()
  22. if(NOT EXISTS ${ly_game_resource_folder})
  23. list(JOIN candidate_paths " " formatted_error)
  24. message(FATAL_ERROR "Missing 'Resources' folder. Candidate paths tried were: ${formatted_error}")
  25. endif()
  26. target_sources(${project_name}.GameLauncher PRIVATE ${ly_game_resource_folder}/Images.xcassets)
  27. set_target_properties(${project_name}.GameLauncher PROPERTIES
  28. MACOSX_BUNDLE_INFO_PLIST ${ly_game_resource_folder}/Info.plist
  29. RESOURCE ${ly_game_resource_folder}/Images.xcassets
  30. XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME ${project_name}AppIcon
  31. XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME LaunchImage
  32. )
  33. set(layout_tool_dir ${LY_ROOT_FOLDER}/cmake/Tools)
  34. add_custom_command(TARGET ${project_name}.GameLauncher POST_BUILD
  35. COMMAND ${LY_PYTHON_CMD} layout_tool.py
  36. -p iOS
  37. -a ${LY_ASSET_DEPLOY_ASSET_TYPE}
  38. --project-path ${project_real_path}
  39. -m ${LY_ASSET_DEPLOY_MODE}
  40. --create-layout-root
  41. -l $<TARGET_BUNDLE_DIR:${project_name}.GameLauncher>/assets
  42. --build-config $<CONFIG>
  43. --warn-on-missing-assets
  44. --verify
  45. --copy
  46. --override-pak-folder ${project_real_path}/AssetBundling/Bundles
  47. ${LY_OVERRIDE_PAK_ARGUMENT}
  48. WORKING_DIRECTORY ${layout_tool_dir}
  49. COMMENT "Synchronizing Layout Assets ..."
  50. VERBATIM
  51. )