runtime_install_mac.cmake.in 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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_path(SET file_path "${CMAKE_INSTALL_PREFIX}/@install_relative_binaries_path@/@runtime_output_filename@")
  9. cmake_path(GET file_path EXTENSION LAST_ONLY file_ext)
  10. if(file_ext STREQUAL .app)
  11. file(INSTALL @CMAKE_BINARY_DIR@/runtime_install/$<CONFIG>/BinariesInstallPath.setreg
  12. DESTINATION ${file_path}/Contents/MacOS/Registry
  13. )
  14. if(EXISTS "${file_path}/Contents/Frameworks/Python.framework")
  15. codesign_python_framework_binaries("${file_path}/Contents/Frameworks/Python.framework")
  16. endif()
  17. else()
  18. find_program(LY_INSTALL_NAME_TOOL install_name_tool)
  19. if (NOT LY_INSTALL_NAME_TOOL)
  20. message(FATAL_ERROR "Unable to locate 'install_name_tool'")
  21. endif()
  22. execute_process(COMMAND
  23. ${LY_INSTALL_NAME_TOOL} -add_rpath @loader_path ${file_path})
  24. endif()
  25. codesign_file("${file_path}" "@entitlement_file@")