PreInstallSteps_mac.cmake.in 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. cmake_minimum_required(VERSION 3.22)
  9. # The O3DE SDK will be shipped as an app bundle. So we create an O3DE_SDK.app directory
  10. # and install SDK into the app's Contents/Engine directory.
  11. set(LY_INSTALL_PATH_ORIGINAL ${CMAKE_INSTALL_PREFIX})
  12. file(INSTALL @LY_ROOT_FOLDER@/Code/Tools/BundleLauncher/info.plist
  13. DESTINATION ${CMAKE_INSTALL_PREFIX}/O3DE_SDK.app/Contents
  14. )
  15. # This SDK launcher will install python site-packages and then launch the ProjectManager
  16. # when a user double clicks on the SDK from Finder. We're only going to need one version
  17. # of the SDK launcher regardless of what configs of the engine are installed.
  18. if (EXISTS @CMAKE_BINARY_DIR@/bin/profile/O3DE_SDK)
  19. set(sdk_launcher_config profile)
  20. elseif (EXISTS @CMAKE_BINARY_DIR@/bin/debug/O3DE_SDK)
  21. set(sdk_launcher_config debug)
  22. elseif (EXISTS @CMAKE_BINARY_DIR@/bin/release/O3DE_SDK)
  23. set(sdk_launcher_config release)
  24. endif()
  25. file(INSTALL @CMAKE_BINARY_DIR@/bin/${sdk_launcher_config}/O3DE_SDK
  26. DESTINATION ${CMAKE_INSTALL_PREFIX}/O3DE_SDK.app/Contents/MacOS
  27. USE_SOURCE_PERMISSIONS
  28. )
  29. file(INSTALL @CMAKE_BINARY_DIR@/runtime_install/${sdk_launcher_config}/BinariesInstallPath.setreg
  30. DESTINATION ${CMAKE_INSTALL_PREFIX}/O3DE_SDK.app/Contents/MacOS/Registry
  31. )
  32. # We need to update the CMAKE_INSTALL_PREFIX so that the engine is installed inside the app bundle.
  33. file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/O3DE_SDK.app/Contents/Engine)
  34. set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/O3DE_SDK.app/Contents/Engine)