CMakeLists.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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(core_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}")
  9. o3de_pal_dir(editor_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Editor/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}")
  10. set(editor_common_dir ${CMAKE_CURRENT_LIST_DIR}/Editor/Platform/Common)
  11. ly_add_target(
  12. NAME ${gem_name}StaticLib STATIC
  13. NAMESPACE Gem
  14. FILES_CMAKE
  15. emotionfx_shared_files.cmake
  16. MCore/mcore_files.cmake
  17. EMotionFX/emotionfx_files.cmake
  18. EMotionFX/CommandSystem/commandsystem_files.cmake
  19. EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake
  20. ${core_pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  21. PLATFORM_INCLUDE_FILES
  22. ${core_pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
  23. INCLUDE_DIRECTORIES
  24. PUBLIC
  25. .
  26. Include
  27. Source
  28. BUILD_DEPENDENCIES
  29. PUBLIC
  30. AZ::AzCore
  31. AZ::AzFramework
  32. Legacy::CryCommon
  33. PUBLIC
  34. AZ::AtomCore
  35. Gem::Atom_RPI.Public
  36. Gem::CommonFeaturesAtom.Static
  37. Gem::LmbrCentral
  38. COMPILE_DEFINITIONS
  39. PUBLIC
  40. EMFX_DEVELOPMENT_BUILD
  41. EMFX_ANIMGRAPH_PROFILER_ENABLED
  42. )
  43. ly_add_target(
  44. NAME ${gem_name}.Static STATIC
  45. NAMESPACE Gem
  46. FILES_CMAKE
  47. emotionfx_files.cmake
  48. BUILD_DEPENDENCIES
  49. PUBLIC
  50. Gem::${gem_name}StaticLib
  51. )
  52. ly_add_target(
  53. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  54. NAMESPACE Gem
  55. FILES_CMAKE
  56. Source/Integration/System/emotionfx_module_files.cmake
  57. BUILD_DEPENDENCIES
  58. PRIVATE
  59. Gem::${gem_name}.Static
  60. RUNTIME_DEPENDENCIES
  61. Gem::LmbrCentral
  62. )
  63. # Inject the gem name into the Module source file
  64. ly_add_source_properties(
  65. SOURCES
  66. Source/Integration/System/AnimationModule.cpp
  67. PROPERTY COMPILE_DEFINITIONS
  68. VALUES
  69. O3DE_GEM_NAME=${gem_name}
  70. O3DE_GEM_VERSION=${gem_version})
  71. # Clients and servers use the above ${gem_name} module
  72. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS ${gem_name})
  73. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS ${gem_name})
  74. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS ${gem_name})
  75. if (PAL_TRAIT_BUILD_HOST_TOOLS)
  76. ly_add_target(
  77. NAME ${gem_name}.Editor.Static STATIC
  78. NAMESPACE Gem
  79. AUTOMOC
  80. AUTORCC
  81. FILES_CMAKE
  82. emotionfx_files.cmake
  83. emotionfx_editor_files.cmake
  84. MysticQt/mysticqt_files.cmake
  85. EMotionFX/Tools/EMotionStudio/EMStudioSDK/emstudiosdk_files.cmake
  86. EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/standardplugins_files.cmake
  87. EMotionFX/Pipeline/SceneAPIExt/sceneapi_ext_files.cmake
  88. EMotionFX/Pipeline/RCExt/rc_ext_files.cmake
  89. EMotionFX/Pipeline/EMotionFXBuilder/emotionfxbuilder_files.cmake
  90. ${editor_pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  91. PLATFORM_INCLUDE_FILES
  92. ${editor_pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
  93. INCLUDE_DIRECTORIES
  94. PRIVATE
  95. EMotionFX/Tools
  96. EMotionFX/Pipeline
  97. ${editor_pal_dir}
  98. BUILD_DEPENDENCIES
  99. PUBLIC
  100. ${gem_name}StaticLib
  101. 3rdParty::Qt::OpenGL
  102. 3rdParty::Qt::Widgets
  103. AZ::AssetBuilderSDK
  104. AZ::AzQtComponents
  105. AZ::SceneCore
  106. AZ::SceneData
  107. AZ::SceneUI
  108. AZ::AzToolsFramework
  109. Legacy::Editor.Headers
  110. 3rdParty::OpenGLInterface
  111. Gem::AtomToolsFramework.Static
  112. Gem::AtomToolsFramework.Editor
  113. Gem::GraphCanvasWidgets
  114. COMPILE_DEFINITIONS
  115. PUBLIC
  116. EMFX_EMSTUDIOLYEMBEDDED
  117. EMOTIONFXANIMATION_EDITOR
  118. )
  119. ly_add_target(
  120. NAME ${gem_name}.Editor GEM_MODULE
  121. NAMESPACE Gem
  122. FILES_CMAKE
  123. Source/Integration/System/emotionfx_module_files.cmake
  124. INCLUDE_DIRECTORIES
  125. PRIVATE
  126. EMotionFX/Tools
  127. EMotionFX/Pipeline
  128. BUILD_DEPENDENCIES
  129. PRIVATE
  130. Gem::${gem_name}.Editor.Static
  131. RUNTIME_DEPENDENCIES
  132. Gem::LmbrCentral.Editor
  133. )
  134. # builders and tools use the above ${gem_name}.Editor module
  135. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS ${gem_name}.Editor)
  136. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS ${gem_name}.Editor)
  137. endif()
  138. ################################################################################
  139. # Tests
  140. ################################################################################
  141. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  142. ly_add_target(
  143. NAME ${gem_name}.Tests.Static STATIC
  144. NAMESPACE Gem
  145. FILES_CMAKE
  146. emotionfx_shared_tests_files.cmake
  147. INCLUDE_DIRECTORIES
  148. PUBLIC
  149. Tests
  150. BUILD_DEPENDENCIES
  151. PRIVATE
  152. Gem::${gem_name}.Static
  153. )
  154. ly_add_target(
  155. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  156. NAMESPACE Gem
  157. FILES_CMAKE
  158. emotionfx_tests_files.cmake
  159. Source/Integration/System/emotionfx_module_files.cmake
  160. INCLUDE_DIRECTORIES
  161. PRIVATE
  162. Tests
  163. ${core_pal_dir}
  164. BUILD_DEPENDENCIES
  165. PRIVATE
  166. Legacy::CryCommon
  167. AZ::AzTest
  168. AZ::AzFramework
  169. AZ::AzTestShared
  170. Gem::${gem_name}.Static
  171. Gem::${gem_name}.Tests.Static
  172. )
  173. ly_add_googletest(
  174. NAME Gem::${gem_name}.Tests
  175. LABELS REQUIRES_tiaf
  176. )
  177. list(APPEND testTargets ${gem_name}.Tests)
  178. if (PAL_TRAIT_BUILD_HOST_TOOLS)
  179. ly_add_target(
  180. NAME ${gem_name}.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  181. NAMESPACE Gem
  182. AUTOMOC
  183. FILES_CMAKE
  184. emotionfx_shared_tests_files.cmake
  185. emotionfx_editor_tests_files.cmake
  186. Source/Integration/System/emotionfx_module_files.cmake
  187. INCLUDE_DIRECTORIES
  188. PRIVATE
  189. Tests
  190. Source
  191. EMotionFX/Tools
  192. EMotionFX/Pipeline
  193. ${editor_pal_dir}
  194. BUILD_DEPENDENCIES
  195. PRIVATE
  196. AZ::AzTest
  197. AZ::AzToolsFramework.Tests
  198. 3rdParty::Qt::Test
  199. 3rdParty::Qt::Concurrent
  200. Gem::${gem_name}.Editor.Static
  201. )
  202. ly_add_googletest(
  203. NAME Gem::${gem_name}.Editor.Tests
  204. LABELS REQUIRES_tiaf
  205. )
  206. list(APPEND testTargets ${gem_name}.Editor.Tests)
  207. endif()
  208. ly_add_target_files(
  209. TARGETS
  210. ${testTargets}
  211. FILES
  212. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/EMotionFXBuilderTestAssets/AnimGraphExample.animgraph
  213. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/EMotionFXBuilderTestAssets/AnimGraphExampleNoDependency.animgraph
  214. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/EMotionFXBuilderTestAssets/EmptyAnimGraphExample.animgraph
  215. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/EMotionFXBuilderTestAssets/EmptyMotionSetExample.motionset
  216. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/EMotionFXBuilderTestAssets/MotionSetExample.motionset
  217. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/EMotionFXBuilderTestAssets/MotionSetExampleNoDependency.motionset
  218. OUTPUT_SUBDIRECTORY
  219. Test.Assets/Gems/${gem_name}/Code/Tests/TestAssets/EMotionFXBuilderTestAssets
  220. )
  221. ly_add_target_files(
  222. TARGETS
  223. ${testTargets}
  224. FILES
  225. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin.actor
  226. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin.animgraph
  227. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin.emfxrecording
  228. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin.motionset
  229. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_come_to_stop.motion
  230. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_forward_dive_roll.motion
  231. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_idle.motion
  232. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_jump.motion
  233. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_readyattack_idle.motion
  234. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_run.motion
  235. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_run_turn_left.motion
  236. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_run_turn_right.motion
  237. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_shuffle_turn_left.motion
  238. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_shuffle_turn_right.motion
  239. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_stand_kick_punch_01.motion
  240. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_stand_kick_punch_02.motion
  241. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_stand_kick_punch_03.motion
  242. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_stand_kick_punch_04.motion
  243. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_stand_kick_punch_05.motion
  244. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_stand_kick_punch_06.motion
  245. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_turn_180.motion
  246. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_turn_180_clockwise.motion
  247. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_walk.motion
  248. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_walk_kick_01.motion
  249. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_walk_kick_02.motion
  250. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_walk_kick_03.motion
  251. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_walk_kick_04.motion
  252. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_walk_turn_left.motion
  253. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Rin/rin_walk_turn_right.motion
  254. OUTPUT_SUBDIRECTORY
  255. Test.Assets/Gems/${gem_name}/Code/Tests/TestAssets/Rin
  256. )
  257. ly_add_target_files(
  258. TARGETS
  259. ${testTargets}
  260. FILES
  261. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Pendulum/pendulum.actor
  262. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Pendulum/pendulum.animgraph
  263. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Pendulum/pendulum.emfxrecording
  264. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Pendulum/pendulum.motion
  265. ${CMAKE_CURRENT_SOURCE_DIR}/Tests/TestAssets/Pendulum/pendulum.motionset
  266. OUTPUT_SUBDIRECTORY
  267. Test.Assets/Gems/${gem_name}/Code/Tests/TestAssets/Pendulum
  268. )
  269. endif()