CMakeLists.txt 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}")
  9. include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) #for PAL_TRAIT_NVCLOTH Traits
  10. if(PAL_TRAIT_NVCLOTH_USE_STUB)
  11. include(nvcloth_stub.cmake)
  12. return()
  13. endif()
  14. ly_add_target(
  15. NAME ${gem_name}.Static STATIC
  16. NAMESPACE Gem
  17. FILES_CMAKE
  18. nvcloth_files.cmake
  19. INCLUDE_DIRECTORIES
  20. PRIVATE
  21. Include
  22. Source
  23. BUILD_DEPENDENCIES
  24. PUBLIC
  25. 3rdParty::NvCloth
  26. AZ::AzFramework
  27. Gem::AtomLyIntegration_CommonFeatures.Public
  28. PRIVATE
  29. Gem::EMotionFXStaticLib
  30. )
  31. ly_add_target(
  32. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  33. NAMESPACE Gem
  34. OUTPUT_NAME ${gem_name}.Gem
  35. FILES_CMAKE
  36. nvcloth_shared_files.cmake
  37. INCLUDE_DIRECTORIES
  38. PUBLIC
  39. Include
  40. PRIVATE
  41. Source
  42. BUILD_DEPENDENCIES
  43. PUBLIC
  44. AZ::AzCore
  45. PRIVATE
  46. Gem::${gem_name}.Static
  47. )
  48. # use the NvCloth module in clients and servers:
  49. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  50. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name})
  51. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS Gem::${gem_name})
  52. # Add each "dependencies" entry from the NvCloth gem.json as a dependency to the
  53. # NvCloth Clients, Servers and Unified targets
  54. o3de_add_variant_dependencies_for_gem_dependencies(GEM_NAME ${gem_name} VARIANTS Clients Servers Unified)
  55. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  56. ly_add_target(
  57. NAME ${gem_name}.Editor.Static STATIC
  58. NAMESPACE Gem
  59. AUTOMOC
  60. FILES_CMAKE
  61. nvcloth_editor_files.cmake
  62. INCLUDE_DIRECTORIES
  63. PRIVATE
  64. .
  65. Include
  66. Source
  67. COMPILE_DEFINITIONS
  68. PRIVATE
  69. NVCLOTH_EDITOR
  70. BUILD_DEPENDENCIES
  71. PUBLIC
  72. Gem::${gem_name}.Static
  73. AZ::AzToolsFramework
  74. AZ::SceneCore
  75. )
  76. ly_add_target(
  77. NAME ${gem_name}.Editor GEM_MODULE
  78. NAMESPACE Gem
  79. OUTPUT_NAME ${gem_name}.Editor.Gem
  80. FILES_CMAKE
  81. nvcloth_editor_shared_files.cmake
  82. INCLUDE_DIRECTORIES
  83. PRIVATE
  84. Include
  85. Source
  86. COMPILE_DEFINITIONS
  87. PRIVATE
  88. NVCLOTH_EDITOR
  89. BUILD_DEPENDENCIES
  90. PRIVATE
  91. Gem::${gem_name}.Editor.Static
  92. )
  93. # use the NvCloth.Editor module in dev tools:
  94. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  95. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  96. # Add each "dependencies" entry from the NvCloth gem.json as a dependency to the NvCloth Tools and Builders targets
  97. o3de_add_variant_dependencies_for_gem_dependencies(GEM_NAME ${gem_name} VARIANTS Tools Builders)
  98. endif()
  99. ################################################################################
  100. # Tests
  101. ################################################################################
  102. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  103. ly_add_target(
  104. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  105. NAMESPACE Gem
  106. OUTPUT_NAME ${gem_name}.Tests.Gem
  107. FILES_CMAKE
  108. nvcloth_tests_files.cmake
  109. INCLUDE_DIRECTORIES
  110. PRIVATE
  111. Include
  112. Tests
  113. Source
  114. BUILD_DEPENDENCIES
  115. PRIVATE
  116. AZ::AzTestShared
  117. AZ::AzTest
  118. Gem::${gem_name}.Static
  119. Gem::EMotionFXStaticLib
  120. Gem::EMotionFX.Tests.Static
  121. RUNTIME_DEPENDENCIES
  122. Gem::EMotionFX
  123. )
  124. ly_add_googletest(
  125. NAME Gem::${gem_name}.Tests
  126. LABELS REQUIRES_tiaf
  127. )
  128. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  129. ly_add_target(
  130. NAME ${gem_name}.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  131. NAMESPACE Gem
  132. OUTPUT_NAME ${gem_name}.Editor.Tests.Gem
  133. FILES_CMAKE
  134. nvcloth_editor_tests_files.cmake
  135. INCLUDE_DIRECTORIES
  136. PRIVATE
  137. Include
  138. Tests
  139. Source
  140. COMPILE_DEFINITIONS
  141. PRIVATE
  142. NVCLOTH_EDITOR
  143. BUILD_DEPENDENCIES
  144. PRIVATE
  145. AZ::AzTestShared
  146. AZ::AzTest
  147. AZ::AzToolsFrameworkTestCommon
  148. Gem::${gem_name}.Editor.Static
  149. Gem::EMotionFX.Editor.Static
  150. Gem::EMotionFX.Tests.Static
  151. RUNTIME_DEPENDENCIES
  152. Gem::EMotionFX.Editor
  153. )
  154. ly_add_googletest(
  155. NAME Gem::${gem_name}.Editor.Tests
  156. LABELS REQUIRES_tiaf
  157. )
  158. endif()
  159. endif()