PackagingCodeSign_linux.cmake 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  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. function(ly_sign_binaries in_path)
  9. message(STATUS "Executing package signing...")
  10. file(REAL_PATH "${CPACK_SOURCE_DIR}/.." _root_path)
  11. unset(_signing_command)
  12. cmake_path(SET _sign_script "${_root_path}/scripts/signer/Platform/Linux/signer.sh")
  13. list(APPEND _signing_command
  14. ${_sign_script}
  15. )
  16. message(STATUS "Signing package files in ${in_path}")
  17. execute_process(
  18. COMMAND ${_signing_command} ${in_path}
  19. RESULT_VARIABLE _signing_result
  20. ERROR_VARIABLE _signing_errors
  21. OUTPUT_VARIABLE _signing_output
  22. ECHO_OUTPUT_VARIABLE
  23. )
  24. if(NOT ${_signing_result} EQUAL 0)
  25. message(FATAL_ERROR "An error occurred during signing files. ${_signing_errors}")
  26. else()
  27. message(STATUS "Signing complete!")
  28. endif()
  29. endfunction()