CMakeLists.txt 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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}.Static STATIC
  12. NAMESPACE Gem
  13. FILES_CMAKE
  14. lyshine_static_files.cmake
  15. ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  16. INCLUDE_DIRECTORIES
  17. PRIVATE
  18. Source
  19. PUBLIC
  20. Include
  21. BUILD_DEPENDENCIES
  22. PRIVATE
  23. Legacy::CryCommon
  24. Gem::LmbrCentral
  25. PUBLIC
  26. Gem::Atom_RPI.Public
  27. Gem::Atom_Utils.Static
  28. Gem::CommonFeaturesAtom.Static
  29. Gem::Atom_Bootstrap.Headers
  30. Gem::AtomFont
  31. Gem::TextureAtlas
  32. )
  33. ly_add_target(
  34. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  35. NAMESPACE Gem
  36. FILES_CMAKE
  37. lyshine_common_module_files.cmake
  38. INCLUDE_DIRECTORIES
  39. PRIVATE
  40. Source
  41. PUBLIC
  42. Include
  43. BUILD_DEPENDENCIES
  44. PRIVATE
  45. Gem::${gem_name}.Static
  46. Legacy::CryCommon
  47. Gem::LmbrCentral.API
  48. PUBLIC
  49. Gem::Atom_RHI.Reflect
  50. Gem::Atom_RPI.Public
  51. RUNTIME_DEPENDENCIES
  52. Gem::LmbrCentral
  53. Gem::TextureAtlas
  54. )
  55. # Inject the gem name into the Module source file
  56. ly_add_source_properties(
  57. SOURCES
  58. Source/LyShineModule.cpp
  59. PROPERTY COMPILE_DEFINITIONS
  60. VALUES
  61. O3DE_GEM_NAME=${gem_name}
  62. O3DE_GEM_VERSION=${gem_version})
  63. # by default, load the above "Gem::${gem_name}" module in Client and Server applications:
  64. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  65. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name})
  66. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS Gem::${gem_name})
  67. # create an alias for other gems to depend on an ${gem_name} public API (may be converted to a target in the future):
  68. ly_create_alias(NAME ${gem_name}.Clients.API NAMESPACE Gem TARGETS Gem::${gem_name}.Clients)
  69. ly_create_alias(NAME ${gem_name}.Servers.API NAMESPACE Gem TARGETS Gem::${gem_name}.Servers)
  70. ly_create_alias(NAME ${gem_name}.Unified.API NAMESPACE Gem TARGETS Gem::${gem_name}.Unified)
  71. if (PAL_TRAIT_BUILD_HOST_TOOLS)
  72. ly_add_target(
  73. NAME ${gem_name}.Tools.Static STATIC
  74. NAMESPACE Gem
  75. AUTOMOC
  76. AUTOUIC
  77. AUTORCC
  78. FILES_CMAKE
  79. lyshine_uicanvaseditor_files.cmake
  80. INCLUDE_DIRECTORIES
  81. PRIVATE
  82. .
  83. Source
  84. Editor
  85. Include
  86. BUILD_DEPENDENCIES
  87. PRIVATE
  88. 3rdParty::Qt::Core
  89. 3rdParty::Qt::Gui
  90. 3rdParty::Qt::Widgets
  91. AZ::AzCore
  92. AZ::AzToolsFramework
  93. Legacy::EditorCommon
  94. Legacy::EditorCore
  95. Gem::${gem_name}.Static
  96. Legacy::CryCommon
  97. Gem::LmbrCentral.Editor.Static
  98. Gem::TextureAtlas.Static
  99. Gem::AtomToolsFramework.Static
  100. ${additional_dependencies}
  101. PUBLIC
  102. Gem::Atom_RPI.Public
  103. Gem::Atom_Utils.Static
  104. Gem::CommonFeaturesAtom.Static
  105. Gem::Atom_Bootstrap.Headers
  106. )
  107. ly_add_target(
  108. NAME ${gem_name}.Tools GEM_MODULE
  109. NAMESPACE Gem
  110. FILES_CMAKE
  111. lyshine_common_module_files.cmake
  112. COMPILE_DEFINITIONS
  113. PRIVATE
  114. LYSHINE_EDITOR
  115. INCLUDE_DIRECTORIES
  116. PRIVATE
  117. .
  118. Source
  119. Editor
  120. Include
  121. BUILD_DEPENDENCIES
  122. PRIVATE
  123. Legacy::CryCommon
  124. AZ::AzToolsFramework
  125. Gem::${gem_name}.Tools.Static
  126. Gem::LmbrCentral.Editor.Static
  127. Gem::TextureAtlas.Static
  128. RUNTIME_DEPENDENCIES
  129. Gem::LmbrCentral.Editor
  130. Gem::TextureAtlas.Editor
  131. Gem::UiBasics.Tools
  132. )
  133. # by naming this target ${gem_name}.Builders it ensures that it is loaded
  134. # in any pipeline tools (Like Asset Processor, AssetBuilder, etc)
  135. ly_add_target(
  136. NAME ${gem_name}.Builders.Static STATIC
  137. NAMESPACE Gem
  138. FILES_CMAKE
  139. lyshine_editor_builder_files.cmake
  140. INCLUDE_DIRECTORIES
  141. PRIVATE
  142. .
  143. Source
  144. PUBLIC
  145. Include
  146. BUILD_DEPENDENCIES
  147. PRIVATE
  148. AZ::AzCore
  149. AZ::AzToolsFramework
  150. AZ::AssetBuilderSDK
  151. Gem::${gem_name}.Static
  152. Legacy::CryCommon
  153. Gem::LmbrCentral.Editor
  154. Gem::TextureAtlas.Editor
  155. Gem::AtomToolsFramework.Static
  156. Gem::AtomToolsFramework.Editor
  157. ${additional_dependencies}
  158. PUBLIC
  159. Gem::Atom_RPI.Public
  160. Gem::Atom_Utils.Static
  161. Gem::CommonFeaturesAtom.Static
  162. Gem::Atom_Bootstrap.Headers
  163. )
  164. ly_add_target(
  165. NAME ${gem_name}.Builders GEM_MODULE
  166. NAMESPACE Gem
  167. FILES_CMAKE
  168. lyshine_common_module_files.cmake
  169. COMPILE_DEFINITIONS
  170. PRIVATE
  171. LYSHINE_BUILDER
  172. INCLUDE_DIRECTORIES
  173. PRIVATE
  174. .
  175. Source
  176. Editor
  177. PUBLIC
  178. Include
  179. BUILD_DEPENDENCIES
  180. PRIVATE
  181. Legacy::CryCommon
  182. AZ::AssetBuilderSDK
  183. Gem::${gem_name}.Builders.Static
  184. Gem::LmbrCentral.Editor.Static
  185. Gem::TextureAtlas.Static
  186. RUNTIME_DEPENDENCIES
  187. Gem::UiBasics.Builders
  188. )
  189. endif()
  190. ################################################################################
  191. # Tests
  192. ################################################################################
  193. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  194. ly_add_target(
  195. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  196. NAMESPACE Gem
  197. FILES_CMAKE
  198. lyshine_common_module_files.cmake
  199. lyshine_tests_files.cmake
  200. COMPILE_DEFINITIONS
  201. PRIVATE
  202. LYSHINE_TESTS
  203. INCLUDE_DIRECTORIES
  204. PRIVATE
  205. Tests
  206. Source
  207. BUILD_DEPENDENCIES
  208. PRIVATE
  209. AZ::AzTest
  210. Gem::${gem_name}.Static
  211. Legacy::CryCommon
  212. Gem::LmbrCentral.API
  213. RUNTIME_DEPENDENCIES
  214. Gem::LmbrCentral
  215. Gem::TextureAtlas
  216. )
  217. ly_add_googletest(
  218. NAME Gem::${gem_name}.Tests
  219. LABELS REQUIRES_tiaf
  220. )
  221. if (PAL_TRAIT_BUILD_HOST_TOOLS)
  222. ly_add_target(
  223. NAME ${gem_name}.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  224. NAMESPACE Gem
  225. FILES_CMAKE
  226. lyshine_common_module_files.cmake
  227. lyshine_editor_tests_files.cmake
  228. COMPILE_DEFINITIONS
  229. PRIVATE
  230. LYSHINE_EDITOR
  231. LYSHINE_BUILDER
  232. INCLUDE_DIRECTORIES
  233. PRIVATE
  234. Tests
  235. Source
  236. Editor
  237. Pipeline
  238. .
  239. BUILD_DEPENDENCIES
  240. PRIVATE
  241. AZ::AzTest
  242. Legacy::CryCommon
  243. AZ::AssetBuilderSDK
  244. AZ::AzToolsFrameworkTestCommon
  245. Gem::${gem_name}.Tools.Static
  246. Gem::${gem_name}.Builders.Static
  247. Gem::LmbrCentral.Editor.Static
  248. Gem::TextureAtlas.Static
  249. RUNTIME_DEPENDENCIES
  250. Gem::LmbrCentral.Editor
  251. Gem::TextureAtlas.Editor
  252. )
  253. ly_add_googletest(
  254. NAME Gem::${gem_name}.Editor.Tests
  255. LABELS REQUIRES_tiaf
  256. )
  257. endif()
  258. endif()