CMakeLists.txt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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_gem_setup("AtomTressFX")
  9. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  10. # Declare ATOMTRESSFX_EDITOR only when tools pipeline is built
  11. # This is in order to allow AzToolsFramework to properly link across
  12. # platforms that support editor mode, while in the rest,
  13. # this module is not included to avoid compiling the editor components.
  14. set_source_files_properties(
  15. Code/HairModule.cpp
  16. Code/Components/EditorHairComponent.h
  17. Code/Components/EditorHairComponent.cpp
  18. PROPERTIES
  19. COMPILE_DEFINITIONS
  20. ATOMTRESSFX_EDITOR
  21. )
  22. ly_add_target(
  23. NAME ${gem_name}.Static STATIC
  24. NAMESPACE Gem
  25. FILES_CMAKE
  26. Hair_files.cmake
  27. INCLUDE_DIRECTORIES
  28. PRIVATE
  29. Code
  30. External
  31. External/Code/src
  32. BUILD_DEPENDENCIES
  33. PRIVATE
  34. AZ::AzCore
  35. AZ::AzToolsFramework
  36. Gem::LmbrCentral
  37. Gem::Atom_RHI.Public
  38. Gem::Atom_RPI.Public
  39. Gem::Atom_Feature_Common.Static
  40. Gem::CommonFeaturesAtom.Static
  41. Gem::EMotionFXStaticLib
  42. )
  43. ly_add_target(
  44. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  45. NAMESPACE Gem
  46. FILES_CMAKE
  47. Hair_shared_files.cmake
  48. INCLUDE_DIRECTORIES
  49. PRIVATE
  50. Code/AssetPipeline
  51. Code
  52. External
  53. External/Code/src
  54. BUILD_DEPENDENCIES
  55. PRIVATE
  56. AZ::AzCore
  57. AZ::AzToolsFramework
  58. Gem::Atom_Utils.Static
  59. Gem::EMotionFXStaticLib
  60. Gem::${gem_name}.Static
  61. )
  62. else()
  63. ly_add_target(
  64. NAME ${gem_name}.Static STATIC
  65. NAMESPACE Gem
  66. FILES_CMAKE
  67. Hair_files.cmake
  68. INCLUDE_DIRECTORIES
  69. PRIVATE
  70. Code
  71. External
  72. External/Code/src
  73. BUILD_DEPENDENCIES
  74. PRIVATE
  75. AZ::AzCore
  76. Gem::LmbrCentral
  77. Gem::Atom_RHI.Public
  78. Gem::Atom_RPI.Public
  79. Gem::Atom_Feature_Common.Static
  80. Gem::CommonFeaturesAtom.Static
  81. Gem::EMotionFXStaticLib
  82. )
  83. ly_add_target(
  84. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  85. NAMESPACE Gem
  86. FILES_CMAKE
  87. Hair_shared_files.cmake
  88. INCLUDE_DIRECTORIES
  89. PRIVATE
  90. Code/AssetPipeline
  91. Code
  92. External
  93. External/Code/src
  94. BUILD_DEPENDENCIES
  95. PRIVATE
  96. AZ::AzCore
  97. Gem::Atom_Utils.Static
  98. Gem::EMotionFXStaticLib
  99. Gem::${gem_name}.Static
  100. )
  101. endif()
  102. # Inject the gem name into the Module source file
  103. ly_add_source_properties(
  104. SOURCES
  105. Code/HairModule.h
  106. PROPERTY COMPILE_DEFINITIONS
  107. VALUES
  108. O3DE_GEM_NAME=${gem_name}
  109. O3DE_GEM_VERSION=${gem_version})
  110. # Clients and servers use the ${gem_name} module
  111. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  112. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name})
  113. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS Gem::${gem_name})
  114. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  115. ly_add_target(
  116. NAME ${gem_name}.Builders.Static STATIC
  117. NAMESPACE Gem
  118. FILES_CMAKE
  119. Hair_builders_files.cmake
  120. INCLUDE_DIRECTORIES
  121. PRIVATE
  122. Code
  123. External
  124. External/Code/src
  125. BUILD_DEPENDENCIES
  126. PUBLIC
  127. AZ::AssetBuilderSDK
  128. Gem::${gem_name}.Static
  129. )
  130. ly_add_target(
  131. NAME ${gem_name}.Builders GEM_MODULE
  132. NAMESPACE Gem
  133. FILES_CMAKE
  134. Hair_builders_shared_files.cmake
  135. INCLUDE_DIRECTORIES
  136. PRIVATE
  137. Code
  138. External
  139. External/Code/src
  140. BUILD_DEPENDENCIES
  141. PRIVATE
  142. Gem::${gem_name}.Builders.Static
  143. )
  144. # Inject the gem name into the Module source file
  145. ly_add_source_properties(
  146. SOURCES
  147. Code/Builders/HairBuilderModule.h
  148. PROPERTY COMPILE_DEFINITIONS
  149. VALUES
  150. O3DE_GEM_NAME=${gem_name}
  151. O3DE_GEM_VERSION=${gem_version})
  152. # builders and tools use the ${gem_name}.Builders and ${gem_name} modules
  153. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name} Gem::${gem_name}.Builders)
  154. endif()