Install_ios.cmake 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. include(cmake/Platform/Common/Install_common.cmake)
  9. #! ly_setup_target_install_targets_override: iOS specific target installation
  10. function(ly_setup_target_install_targets_override)
  11. set(options)
  12. set(oneValueArgs TARGET ARCHIVE_DIR LIBRARY_DIR RUNTIME_DIR LIBRARY_SUBDIR RUNTIME_SUBDIR)
  13. set(multiValueArgs)
  14. cmake_parse_arguments(ly_platform_install_target "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
  15. # For bundles on iOS(/Mac), we set the icons by passing in a path to the Images.xcassets directory.
  16. # However, the CMake install command expects paths to files for the the RESOURCE property.
  17. # More details can be found in the CMake issue: https://gitlab.kitware.com/cmake/cmake/-/issues/22409
  18. get_target_property(is_bundle ${ly_platform_install_target_TARGET} MACOSX_BUNDLE)
  19. if (${is_bundle})
  20. get_target_property(cached_resources_dir ${ly_platform_install_target_TARGET} RESOURCE)
  21. set_property(TARGET ${ly_platform_install_target_TARGET} PROPERTY RESOURCE "")
  22. endif()
  23. foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
  24. string(TOUPPER ${conf} UCONF)
  25. ly_install(TARGETS ${TARGET_NAME}
  26. ARCHIVE
  27. DESTINATION ${ly_platform_install_target_ARCHIVE_DIR}
  28. COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
  29. CONFIGURATIONS ${conf}
  30. LIBRARY
  31. DESTINATION ${ly_platform_install_target_LIBRARY_DIR}/${ly_platform_install_target_LIBRARY_SUBDIR}
  32. COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
  33. CONFIGURATIONS ${conf}
  34. RUNTIME
  35. DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${ly_platform_install_target_RUNTIME_SUBDIR}
  36. COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
  37. CONFIGURATIONS ${conf}
  38. BUNDLE
  39. DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${ly_platform_install_target_RUNTIME_SUBDIR}
  40. COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
  41. CONFIGURATIONS ${conf}
  42. RESOURCE
  43. DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${ly_platform_install_target_RUNTIME_SUBDIR}
  44. COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
  45. CONFIGURATIONS ${conf}
  46. FRAMEWORK
  47. DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${ly_platform_install_target_RUNTIME_SUBDIR}
  48. COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
  49. CONFIGURATIONS ${conf}
  50. )
  51. endforeach()
  52. if (${is_bundle})
  53. set_property(TARGET ${ly_platform_install_target_TARGET} PROPERTY RESOURCE ${cached_resources_dir})
  54. endif()
  55. endfunction()