CMakeLists.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. ly_add_target(
  12. NAME ${gem_name}.Static STATIC
  13. NAMESPACE Gem
  14. FILES_CMAKE
  15. pythonassetbuilder_common_files.cmake
  16. PLATFORM_INCLUDE_FILES
  17. Source/Platform/Common/${PAL_TRAIT_COMPILER_ID}/pythonassetbuilder_static_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
  18. INCLUDE_DIRECTORIES
  19. PRIVATE
  20. .
  21. Source
  22. PUBLIC
  23. Include
  24. BUILD_DEPENDENCIES
  25. PRIVATE
  26. AZ::AzCore
  27. PUBLIC
  28. 3rdParty::Python
  29. Gem::EditorPythonBindings.Static
  30. AZ::AssetBuilderSDK
  31. AZ::AzToolsFramework
  32. )
  33. ly_add_target(
  34. NAME ${gem_name}.Editor GEM_MODULE
  35. NAMESPACE Gem
  36. FILES_CMAKE
  37. pythonassetbuilder_editor_files.cmake
  38. pythonassetbuilder_shared_files.cmake
  39. PLATFORM_INCLUDE_FILES
  40. Source/Platform/Common/${PAL_TRAIT_COMPILER_ID}/pythonassetbuilder_static_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
  41. INCLUDE_DIRECTORIES
  42. PRIVATE
  43. .
  44. Source
  45. PUBLIC
  46. Include
  47. BUILD_DEPENDENCIES
  48. PRIVATE
  49. Gem::EditorPythonBindings.Static
  50. AZ::AssetBuilderSDK
  51. RUNTIME_DEPENDENCIES
  52. Gem::EditorPythonBindings.Editor
  53. )
  54. # Inject the gem name into the Module source file
  55. ly_add_source_properties(
  56. SOURCES
  57. Source/PythonAssetBuilderModule.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)
  66. ################################################################################
  67. # Tests
  68. ################################################################################
  69. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  70. ly_add_target(
  71. NAME ${gem_name}.Tests MODULE
  72. NAMESPACE Gem
  73. FILES_CMAKE
  74. pythonassetbuilder_tests_files.cmake
  75. PLATFORM_INCLUDE_FILES
  76. Source/Platform/Common/${PAL_TRAIT_COMPILER_ID}/pythonassetbuilder_tests_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
  77. INCLUDE_DIRECTORIES
  78. PRIVATE
  79. .
  80. Source
  81. Tests
  82. BUILD_DEPENDENCIES
  83. PRIVATE
  84. AZ::AzTest
  85. Gem::${gem_name}.Static
  86. )
  87. ly_add_googletest(
  88. NAME Gem::${gem_name}.Tests
  89. LABELS REQUIRES_tiaf
  90. )
  91. endif()