install_AWSNativeSDK_mac.sh 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. #
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. src_path=temp/src
  9. bld_path=temp/build
  10. inst_path=temp/install
  11. out_bin_path=$TARGET_INSTALL_ROOT/bin
  12. mkdir -p $out_bin_path/Debug
  13. mkdir -p $out_bin_path/Release
  14. out_include_path=$TARGET_INSTALL_ROOT/include
  15. mkdir -p $out_include_path
  16. out_lib_path=$TARGET_INSTALL_ROOT/lib
  17. mkdir -p $out_lib_path/Debug
  18. mkdir -p $out_lib_path/Release
  19. copy_shared_and_static_libs() {
  20. local bld_type=$1
  21. echo "Copying shared .dylib to $out_bin_path/$bld_type"
  22. cp -f "$inst_path/${bld_type}_Shared/lib/"*".dylib" $out_bin_path/$bld_type/ || (echo "Copying shared .dylib to $out_bin_path/$bld_type failed" ; exit 1)
  23. echo "Copying static .a to $out_lib_path/$bld_type"
  24. cp -f "$inst_path/${bld_type}_Static/lib/"*".a" $out_lib_path/$bld_type/ || (echo "Copying static .a to $out_lib_path/$bld_type failed" ; exit 1)
  25. }
  26. # Debug
  27. echo "CMake Install Debug Shared to $inst_path"
  28. cmake --install $bld_path/Debug_Shared --prefix $inst_path/Debug_Shared --config Debug || (echo "CMake Install Debug Shared to $inst_path failed" ; exit 1)
  29. echo "CMake Install Debug Static to $inst_path"
  30. cmake --install $bld_path/Debug_Static --prefix $inst_path/Debug_Static --config Debug || (echo "CMake Install Debug Static to $inst_path failed" ; exit 1)
  31. copy_shared_and_static_libs Debug || exit 1
  32. # Release
  33. echo "CMake Install Release Shared to $inst_path"
  34. cmake --install $bld_path/Release_Shared --prefix $inst_path/Release_Shared --config Release || (echo "CMake Install Release Shared to $inst_path failed" ; exit 1)
  35. echo "CMake Install Release Static to $inst_path"
  36. cmake --install $bld_path/Release_Static --prefix $inst_path/Release_Static --config Release || (echo "CMake Install Release Static to $inst_path failed" ; exit 1)
  37. copy_shared_and_static_libs Release || exit 1
  38. echo "Copying include headers to $out_include_path"
  39. cp -f -R "$inst_path/Release_Static/include/"* $out_include_path/ || (echo "Copying include headers to $out_include_path failed" ; exit 1)
  40. echo "Copying LICENSE.txt to $TARGET_INSTALL_ROOT"
  41. cp -f $src_path/LICENSE.txt $TARGET_INSTALL_ROOT/ || (echo "Copying LICENSE.txt to $TARGET_INSTALL_ROOT failed" ; exit 1)
  42. echo "Custom Install for AWSNativeSDK finished successfully"
  43. exit 0