get_python.cmake 1.0 KB

12345678910111213141516171819202122232425262728293031
  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. # to use this script, invoke it using CMake script mode (-P option)
  8. # with the cwd being the engine root folder (the one with cmake as a subfolder)
  9. # on the command line, define LY_3RDPARTY_PATH to a valid directory
  10. # and PAL_PLATFORM_NAME to the platform you'd like to get or update python for.
  11. # defines must come before the script call.
  12. # example:
  13. # cmake -DPAL_PLATFORM_NAME:string=Windows -DLY_3RDPARTY_PATH:string=%CMD_DIR% -P get_python.cmake
  14. cmake_minimum_required(VERSION 3.22)
  15. if(LY_3RDPARTY_PATH)
  16. file(TO_CMAKE_PATH ${LY_3RDPARTY_PATH} LY_3RDPARTY_PATH)
  17. endif()
  18. function(o3de_current_file_path path)
  19. set(${path} ${CMAKE_CURRENT_FUNCTION_LIST_DIR} PARENT_SCOPE)
  20. endfunction()
  21. o3de_current_file_path(current_path)
  22. file(REAL_PATH ${current_path}/.. LY_ROOT_FOLDER)
  23. set(LY_PACKAGE_KEEP_AFTER_DOWNLOADING FALSE)
  24. include(cmake/LYPython.cmake)