CMakeLists.txt 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. ly_add_target(
  9. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  10. NAMESPACE Gem
  11. FILES_CMAKE
  12. sceneprocessing_files.cmake
  13. INCLUDE_DIRECTORIES
  14. PUBLIC
  15. Include
  16. BUILD_DEPENDENCIES
  17. PRIVATE
  18. AZ::AzCore
  19. )
  20. # Inject the gem name into the Module source file
  21. ly_add_source_properties(
  22. SOURCES
  23. Source/SceneProcessingModuleStub.cpp
  24. PROPERTY COMPILE_DEFINITIONS
  25. VALUES
  26. O3DE_GEM_NAME=${gem_name}
  27. O3DE_GEM_VERSION=${gem_version})
  28. if (PAL_TRAIT_BUILD_HOST_TOOLS)
  29. ly_add_target(
  30. NAME ${gem_name}.Editor.Static STATIC
  31. NAMESPACE Gem
  32. AUTOMOC
  33. FILES_CMAKE
  34. sceneprocessing_editor_static_files.cmake
  35. INCLUDE_DIRECTORIES
  36. PRIVATE
  37. Source
  38. .
  39. PUBLIC
  40. Include
  41. BUILD_DEPENDENCIES
  42. PUBLIC
  43. 3rdParty::Qt::Widgets
  44. 3rdParty::mikkelsen
  45. AZ::AzCore
  46. AZ::SceneCore
  47. AZ::SceneData
  48. AZ::AzFramework
  49. AZ::SceneBuilder
  50. AZ::AssetBuilderSDK
  51. )
  52. ly_add_target(
  53. NAME ${gem_name}.Editor GEM_MODULE
  54. NAMESPACE Gem
  55. FILES_CMAKE
  56. sceneprocessing_editor_files.cmake
  57. INCLUDE_DIRECTORIES
  58. PRIVATE
  59. Source
  60. .
  61. PUBLIC
  62. Include
  63. BUILD_DEPENDENCIES
  64. PRIVATE
  65. Gem::${gem_name}.Editor.Static
  66. RUNTIME_DEPENDENCIES
  67. AZ::SceneCore
  68. AZ::SceneData
  69. AZ::SceneUI
  70. )
  71. # Inject the gem name into the Module source file
  72. ly_add_source_properties(
  73. SOURCES
  74. Source/SceneProcessingModule.cpp
  75. PROPERTY COMPILE_DEFINITIONS
  76. VALUES
  77. O3DE_GEM_NAME=${gem_name}
  78. O3DE_GEM_VERSION=${gem_version})
  79. # the ${gem_name}.Editor module above is only used in Builders and Tools.
  80. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  81. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  82. # ${gem_name} Gem is only used in Tools and builders and is a requirement for the Editor and AssetProcessor
  83. endif()
  84. ################################################################################
  85. # Tests
  86. ################################################################################
  87. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  88. ly_add_target(
  89. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  90. NAMESPACE Gem
  91. FILES_CMAKE
  92. sceneprocessing_tests_files.cmake
  93. INCLUDE_DIRECTORIES
  94. PRIVATE
  95. Tests
  96. BUILD_DEPENDENCIES
  97. PRIVATE
  98. AZ::AzTest
  99. RUNTIME_DEPENDENCIES
  100. Gem::${gem_name}
  101. )
  102. # Commented out as currently there are no ${gem_name} tests
  103. # ly_add_googletest(
  104. # NAME Gem::${gem_name}.Tests
  105. # )
  106. if (PAL_TRAIT_BUILD_HOST_TOOLS)
  107. ly_add_target(
  108. NAME ${gem_name}.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  109. NAMESPACE Gem
  110. FILES_CMAKE
  111. sceneprocessing_editor_tests_files.cmake
  112. INCLUDE_DIRECTORIES
  113. PRIVATE
  114. Tests
  115. Source
  116. BUILD_DEPENDENCIES
  117. PRIVATE
  118. Gem::${gem_name}.Editor.Static
  119. AZ::AzTest
  120. AZ::SceneData
  121. AZ::AzToolsFrameworkTestCommon
  122. )
  123. ly_add_googletest(
  124. NAME Gem::${gem_name}.Editor.Tests
  125. LABELS REQUIRES_tiaf
  126. )
  127. endif()
  128. endif()