3
0

CMakeLists.txt 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. # Add the ${gem_name}.Static target
  9. ly_add_target(
  10. NAME ${gem_name}.Static STATIC
  11. NAMESPACE Gem
  12. FILES_CMAKE
  13. motionmatching_files.cmake
  14. INCLUDE_DIRECTORIES
  15. PUBLIC
  16. Include
  17. PRIVATE
  18. Source
  19. BUILD_DEPENDENCIES
  20. PUBLIC
  21. AZ::AzCore
  22. AZ::AzFramework
  23. Gem::EMotionFXStaticLib
  24. Gem::ImguiAtom.Static
  25. )
  26. # Here add ${gem_name} target, it depends on the ${gem_name}.Static
  27. ly_add_target(
  28. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  29. NAMESPACE Gem
  30. FILES_CMAKE
  31. motionmatching_shared_files.cmake
  32. INCLUDE_DIRECTORIES
  33. PUBLIC
  34. Include
  35. PRIVATE
  36. Source
  37. BUILD_DEPENDENCIES
  38. PRIVATE
  39. Gem::${gem_name}.Static
  40. Gem::ImGui.Static
  41. Gem::ImGui.ImGuiLYUtils
  42. )
  43. # Inject the gem name into the Module source file
  44. ly_add_source_properties(
  45. SOURCES
  46. Source/MotionMatchingModule.cpp
  47. PROPERTY COMPILE_DEFINITIONS
  48. VALUES
  49. O3DE_GEM_NAME=${gem_name}
  50. O3DE_GEM_VERSION=${gem_version})
  51. # By default, we will specify that the above target ${gem_name} would be used by
  52. # Client and Server type targets when this gem is enabled. If you don't want it
  53. # active in Clients or Servers by default, delete one of both of the following lines:
  54. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  55. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name})
  56. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS Gem::${gem_name})
  57. # If we are on a host platform, we want to add the host tools targets like the ${gem_name}.Editor target which
  58. # will also depend on ${gem_name}.Static
  59. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  60. ly_add_target(
  61. NAME ${gem_name}.Editor.Static STATIC
  62. NAMESPACE Gem
  63. FILES_CMAKE
  64. motionmatching_editor_files.cmake
  65. INCLUDE_DIRECTORIES
  66. PRIVATE
  67. Source
  68. PUBLIC
  69. Include
  70. BUILD_DEPENDENCIES
  71. PUBLIC
  72. AZ::AzToolsFramework
  73. Gem::${gem_name}.Static
  74. )
  75. ly_add_target(
  76. NAME ${gem_name}.Editor GEM_MODULE
  77. NAMESPACE Gem
  78. AUTOMOC
  79. OUTPUT_NAME Gem.${gem_name}.Editor
  80. FILES_CMAKE
  81. motionmatching_editor_shared_files.cmake
  82. INCLUDE_DIRECTORIES
  83. PRIVATE
  84. Source
  85. PUBLIC
  86. Include
  87. BUILD_DEPENDENCIES
  88. PUBLIC
  89. Gem::${gem_name}.Editor.Static
  90. )
  91. # Inject the gem name into the Module source file
  92. ly_add_source_properties(
  93. SOURCES
  94. Source/MotionMatchingEditorModule.cpp
  95. PROPERTY COMPILE_DEFINITIONS
  96. VALUES
  97. O3DE_GEM_NAME=${gem_name}
  98. O3DE_GEM_VERSION=${gem_version})
  99. # By default, we will specify that the above target ${gem_name} would be used by
  100. # Tool and Builder type targets when this gem is enabled. If you don't want it
  101. # active in Tools or Builders by default, delete one of both of the following lines:
  102. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  103. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  104. endif()
  105. ################################################################################
  106. # Tests
  107. ################################################################################
  108. # See if globally, tests are supported
  109. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  110. ly_add_target(
  111. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  112. NAMESPACE Gem
  113. FILES_CMAKE
  114. motionmatching_tests_files.cmake
  115. INCLUDE_DIRECTORIES
  116. PRIVATE
  117. Tests
  118. Source
  119. BUILD_DEPENDENCIES
  120. PRIVATE
  121. AZ::AzTest
  122. AZ::AzFramework
  123. Gem::EMotionFX.Tests.Static
  124. Gem::${gem_name}.Static
  125. )
  126. # Add ${gem_name}.Tests to googletest
  127. ly_add_googletest(
  128. NAME Gem::${gem_name}.Tests
  129. LABELS REQUIRES_tiaf
  130. )
  131. # If we are a host platform we want to add tools test like editor tests here
  132. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  133. ly_add_target(
  134. NAME ${gem_name}.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  135. NAMESPACE Gem
  136. FILES_CMAKE
  137. motionmatching_editor_tests_files.cmake
  138. INCLUDE_DIRECTORIES
  139. PRIVATE
  140. Tests
  141. Source
  142. BUILD_DEPENDENCIES
  143. PRIVATE
  144. AZ::AzTest
  145. Gem::${gem_name}.Editor
  146. )
  147. # Add ${gem_name}.Editor.Tests to googletest
  148. # Commented out as currently there are no ${gem_name} Editor tests
  149. # ly_add_googletest(
  150. # NAME Gem::${gem_name}.Editor.Tests
  151. # )
  152. endif()
  153. endif()