get_python.cmake 1.2 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. # 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. cmake_path(NORMAL_PATH LY_3RDPARTY_PATH)
  18. endif()
  19. if (LY_ROOT_FOLDER)
  20. file(TO_CMAKE_PATH ${LY_ROOT_FOLDER} LY_ROOT_FOLDER)
  21. cmake_path(NORMAL_PATH LY_ROOT_FOLDER)
  22. endif()
  23. set(PAL_HOST_PLATFORM_NAME ${PAL_PLATFORM_NAME})
  24. string(TOLOWER ${PAL_HOST_PLATFORM_NAME} PAL_HOST_PLATFORM_NAME_LOWERCASE)
  25. string(TOLOWER ${PAL_PLATFORM_NAME} PAL_PLATFORM_NAME_LOWERCASE)
  26. include(cmake/LYPython.cmake)