CMakeLists.txt 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. if(NOT PAL_TRAIT_BUILD_HOST_TOOLS)
  9. return()
  10. endif()
  11. set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common)
  12. include(${CMAKE_CURRENT_SOURCE_DIR}/Source/Platform/${PAL_PLATFORM_NAME}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
  13. if(NOT PAL_TRAIT_BUILD_QTFORPYTHON_SUPPORTED)
  14. return()
  15. endif()
  16. ly_add_target(
  17. NAME ${gem_name}.Editor.Static STATIC
  18. NAMESPACE Gem
  19. FILES_CMAKE
  20. qtforpython_editor_files.cmake
  21. ${CMAKE_CURRENT_SOURCE_DIR}/Source/Platform/${PAL_PLATFORM_NAME}/qtforpython_editor_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  22. PLATFORM_INCLUDE_FILES
  23. ${common_source_dir}/${PAL_TRAIT_COMPILER_ID}/qtforpython_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
  24. INCLUDE_DIRECTORIES
  25. PUBLIC
  26. Include
  27. Source
  28. BUILD_DEPENDENCIES
  29. PUBLIC
  30. AZ::AzCore
  31. AZ::AzFramework
  32. AZ::AzToolsFramework
  33. 3rdParty::Qt::Widgets
  34. Gem::EditorPythonBindings.Static
  35. RUNTIME_DEPENDENCIES
  36. 3rdParty::pyside2
  37. 3rdParty::Qt::Test
  38. )
  39. ly_add_target(
  40. NAME ${gem_name}.Editor GEM_MODULE
  41. NAMESPACE Gem
  42. FILES_CMAKE
  43. qtforpython_shared_files.cmake
  44. INCLUDE_DIRECTORIES
  45. PRIVATE
  46. ${CMAKE_CURRENT_SOURCE_DIR}/Source/Platform/${PAL_PLATFORM_NAME}
  47. BUILD_DEPENDENCIES
  48. PRIVATE
  49. Gem::${gem_name}.Editor.Static
  50. RUNTIME_DEPENDENCIES
  51. 3rdParty::pyside2::Tools
  52. Gem::EditorPythonBindings.Editor
  53. )
  54. # Inject the gem name into the Module source file
  55. ly_add_source_properties(
  56. SOURCES
  57. Source/QtForPythonModule.cpp
  58. PROPERTY COMPILE_DEFINITIONS
  59. VALUES
  60. O3DE_GEM_NAME=${gem_name}
  61. O3DE_GEM_VERSION=${gem_version})
  62. # the above target is used in both builders like AssetProcessor and Tools like the Editor
  63. # but is not used in clients or servers
  64. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  65. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)