CMakeLists.txt 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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. o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}")
  9. set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common)
  10. ly_add_target(
  11. NAME ${gem_name}.Public HEADERONLY
  12. NAMESPACE Gem
  13. FILES_CMAKE
  14. atomlyintegration_commonfeatures_public_files.cmake
  15. INCLUDE_DIRECTORIES
  16. INTERFACE
  17. Include
  18. BUILD_DEPENDENCIES
  19. INTERFACE
  20. Gem::Atom_Feature_Common.Public
  21. Gem::AtomImGuiTools.Public
  22. )
  23. # Add alias that references the "AtomLyIntegration_CommonFeatures.Public" for backwards compatibility
  24. ly_create_alias(NAME AtomLyIntegration_CommonFeatures.Public NAMESPACE Gem
  25. TARGETS ${gem_name}.Public)
  26. ly_add_target(
  27. NAME ${gem_name}.Static STATIC
  28. NAMESPACE Gem
  29. FILES_CMAKE
  30. atomlyintegration_commonfeatures_files.cmake
  31. INCLUDE_DIRECTORIES
  32. PRIVATE
  33. .
  34. Source
  35. PUBLIC
  36. Include
  37. BUILD_DEPENDENCIES
  38. PUBLIC
  39. AZ::AzCore
  40. AZ::AzFramework
  41. Gem::${gem_name}.Public
  42. Gem::LmbrCentral.Static
  43. Gem::GradientSignal.Static
  44. Gem::SurfaceData.Static
  45. Gem::Atom_Feature_Common.Public
  46. Gem::Atom_Bootstrap.Headers
  47. )
  48. # Add alias that references the "AtomLyIntegration_CommonFeatures.Static" name for backwards compatibility
  49. ly_create_alias(NAME AtomLyIntegration_CommonFeatures.Static NAMESPACE Gem
  50. TARGETS ${gem_name}.Static)
  51. ly_add_target(
  52. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  53. NAMESPACE Gem
  54. FILES_CMAKE
  55. atomlyintegration_commonfeatures_shared_files.cmake
  56. INCLUDE_DIRECTORIES
  57. PRIVATE
  58. Source
  59. PUBLIC
  60. Include
  61. BUILD_DEPENDENCIES
  62. PRIVATE
  63. Gem::${gem_name}.Static
  64. RUNTIME_DEPENDENCIES
  65. Gem::Atom_RPI.Private
  66. )
  67. # Add alias that references the "AtomLyIntegration_CommonFeatures" name for backwards compatibility
  68. ly_create_alias(NAME AtomLyIntegration_CommonFeatures NAMESPACE Gem
  69. TARGETS ${gem_name})
  70. # Inject the gem name into the Module source file
  71. ly_add_source_properties(
  72. SOURCES
  73. Source/Module.cpp
  74. PROPERTY COMPILE_DEFINITIONS
  75. VALUES
  76. O3DE_GEM_NAME=${gem_name}
  77. O3DE_GEM_VERSION=${gem_version})
  78. # The ${gem_name} module is used for Clients and Servers
  79. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem
  80. TARGETS
  81. Gem::${gem_name}
  82. Gem::GradientSignal.Clients
  83. )
  84. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem
  85. TARGETS
  86. Gem::${gem_name}
  87. Gem::GradientSignal.Servers
  88. )
  89. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem
  90. TARGETS
  91. Gem::${gem_name}
  92. Gem::GradientSignal.Unified
  93. )
  94. # Add aliases that references the legacy "AtomLyIntegration_CommonFeatures" name
  95. # using the real name of the Gem through the ${gem_name} variable
  96. ly_create_alias(NAME Gem::AtomLyIntegration_CommonFeatures.Clients NAMESPACE Gem
  97. TARGETS
  98. ${gem_name}
  99. )
  100. ly_create_alias(NAME Gem::AtomLyIntegration_CommonFeatures.Servers NAMESPACE Gem
  101. TARGETS
  102. ${gem_name}
  103. )
  104. ly_create_alias(NAME Gem::AtomLyIntegration_CommonFeatures.Unified NAMESPACE Gem
  105. TARGETS
  106. ${gem_name}
  107. )
  108. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  109. ly_add_target(
  110. NAME ${gem_name}.Editor.Static STATIC
  111. NAMESPACE Gem
  112. AUTOUIC
  113. AUTOMOC
  114. AUTORCC
  115. FILES_CMAKE
  116. atomlyintegration_commonfeatures_editor_files.cmake
  117. ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  118. PLATFORM_INCLUDE_FILES
  119. ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
  120. INCLUDE_DIRECTORIES
  121. PRIVATE
  122. .
  123. Source
  124. PUBLIC
  125. Include
  126. COMPILE_DEFINITIONS
  127. PRIVATE
  128. ATOMLYINTEGRATION_FEATURE_COMMON_EDITOR
  129. BUILD_DEPENDENCIES
  130. PUBLIC
  131. Gem::${gem_name}.Static
  132. Gem::Atom_RPI.Edit
  133. Gem::AtomToolsFramework.Static
  134. Gem::AtomToolsFramework.Editor
  135. AZ::SceneCore
  136. AZ::SceneData
  137. Legacy::Editor.Headers
  138. Legacy::EditorCommon
  139. Legacy::CryCommon
  140. RUNTIME_DEPENDENCIES
  141. 3rdParty::OpenImageIO::Tools::Binaries
  142. 3rdParty::OpenImageIO::Tools::PythonPlugins
  143. )
  144. ly_add_target(
  145. NAME ${gem_name}.Editor GEM_MODULE
  146. NAMESPACE Gem
  147. FILES_CMAKE
  148. atomlyintegration_commonfeatures_shared_files.cmake
  149. INCLUDE_DIRECTORIES
  150. PRIVATE
  151. Source
  152. PUBLIC
  153. Include
  154. COMPILE_DEFINITIONS
  155. PRIVATE
  156. ATOMLYINTEGRATION_FEATURE_COMMON_EDITOR
  157. BUILD_DEPENDENCIES
  158. PRIVATE
  159. Gem::${gem_name}.Editor.Static
  160. RUNTIME_DEPENDENCIES
  161. Legacy::EditorCommon
  162. )
  163. # Add alias that references the "AtomLyIntegration_CommonFeatures.Editor" for backwards compatibility
  164. ly_create_alias(NAME AtomLyIntegration_CommonFeatures.Editor NAMESPACE Gem
  165. TARGETS ${gem_name}.Editor)
  166. # The ${gem_name}.Editor module is used for Builders and Tools
  167. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem
  168. TARGETS
  169. Gem::${gem_name}.Editor
  170. Gem::Atom_Feature_Common.Builders
  171. Gem::Atom_RPI.Builders
  172. Gem::GradientSignal.Builders
  173. )
  174. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem
  175. TARGETS
  176. Gem::${gem_name}.Editor
  177. Gem::GradientSignal.Tools
  178. )
  179. # Add aliases that references the real name of the gem legacy name "AtomLyIntegration_CommonFeatures"
  180. # Tools and Builders variants using the ${gem_name} variable
  181. ly_create_alias(NAME Gem::AtomLyIntegration_CommonFeatures.Builders NAMESPACE Gem
  182. TARGETS
  183. ${gem_name}
  184. )
  185. ly_create_alias(NAME Gem::AtomLyIntegration_CommonFeatures.Tools NAMESPACE Gem
  186. TARGETS
  187. ${gem_name}
  188. )
  189. ################################################################################
  190. # Tests
  191. ################################################################################
  192. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  193. ly_add_target(
  194. NAME ${gem_name}.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  195. NAMESPACE Gem
  196. FILES_CMAKE
  197. atomlyintegration_commonfeatures_editor_test_files.cmake
  198. INCLUDE_DIRECTORIES
  199. PRIVATE
  200. Tests
  201. Source
  202. BUILD_DEPENDENCIES
  203. PRIVATE
  204. AZ::AzTest
  205. AZ::AzTestShared
  206. AZ::AzToolsFramework
  207. AZ::AzToolsFrameworkTestCommon
  208. Gem::${gem_name}.Static
  209. Gem::${gem_name}.Editor.Static
  210. RUNTIME_DEPENDENCIES
  211. Gem::LmbrCentral.Editor
  212. )
  213. ly_add_googletest(
  214. NAME Gem::${gem_name}.Editor.Tests
  215. LABELS REQUIRES_tiaf
  216. )
  217. endif()
  218. endif()
  219. # AtomLyIntegration_CommonFeatures gem targets are required as part of the Editor and AssetProcessor
  220. # due to the AZ::Render::EditorDirectionalLightComponent, AZ::Render::EditorMeshComponent,
  221. # AZ::Render::EditorGridComponent, AZ::Render::EditorHDRiSkyboxComponent,
  222. # AZ::Render::EditorImageBasedLightComponent being saved as part of the DefaultLevel.prefab