CMakeLists.txt 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. ly_add_target(
  9. NAME ${gem_name}.Static STATIC
  10. NAMESPACE Gem
  11. FILES_CMAKE
  12. gradientsignal_files.cmake
  13. INCLUDE_DIRECTORIES
  14. PRIVATE
  15. Source
  16. PUBLIC
  17. Include
  18. BUILD_DEPENDENCIES
  19. PRIVATE
  20. AZ::AtomCore
  21. PUBLIC
  22. AZ::AzCore
  23. AZ::AzFramework
  24. Gem::Atom_RPI.Public
  25. Gem::SurfaceData
  26. Gem::ImageProcessingAtom.Headers
  27. Gem::LmbrCentral
  28. )
  29. ly_add_target(
  30. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  31. NAMESPACE Gem
  32. FILES_CMAKE
  33. gradientsignal_shared_files.cmake
  34. INCLUDE_DIRECTORIES
  35. PRIVATE
  36. Source
  37. PUBLIC
  38. Include
  39. BUILD_DEPENDENCIES
  40. PRIVATE
  41. Gem::LmbrCentral.API
  42. PUBLIC
  43. AZ::AzCore
  44. Gem::${gem_name}.Static
  45. Gem::ImageProcessingAtom.Headers # Atom/ImageProcessing/PixelFormats.h is part of a header in Includes
  46. RUNTIME_DEPENDENCIES
  47. Gem::LmbrCentral
  48. )
  49. # Inject the gem name into the Module source file
  50. ly_add_source_properties(
  51. SOURCES
  52. Source/GradientSignalModule.cpp
  53. PROPERTY COMPILE_DEFINITIONS
  54. VALUES
  55. O3DE_GEM_NAME=${gem_name}
  56. O3DE_GEM_VERSION=${gem_version})
  57. # Load the "Gem::${gem_name}" module in Clients and Servers
  58. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  59. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name})
  60. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS Gem::${gem_name})
  61. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  62. ly_add_target(
  63. NAME ${gem_name}.Editor.Static STATIC
  64. NAMESPACE Gem
  65. AUTOMOC
  66. FILES_CMAKE
  67. gradientsignal_editor_files.cmake
  68. PLATFORM_INCLUDE_FILES
  69. Source/Platform/Common/${PAL_TRAIT_COMPILER_ID}/gradient_signal_editor_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
  70. INCLUDE_DIRECTORIES
  71. PRIVATE
  72. Source
  73. PUBLIC
  74. Include
  75. COMPILE_DEFINITIONS
  76. PUBLIC
  77. GRADIENTSIGNAL_EDITOR
  78. BUILD_DEPENDENCIES
  79. PRIVATE
  80. 3rdParty::OpenImageIO
  81. Gem::LmbrCentral.Editor
  82. Gem::Atom_RPI.Edit
  83. PUBLIC
  84. 3rdParty::Qt::Widgets
  85. AZ::AzCore
  86. AZ::AzFramework
  87. AZ::AzToolsFramework
  88. AZ::AssetBuilderSDK
  89. Gem::${gem_name}.Static
  90. Gem::SurfaceData
  91. Gem::LmbrCentral.Editor.Static
  92. )
  93. ly_add_target(
  94. NAME ${gem_name}.Editor GEM_MODULE
  95. NAMESPACE Gem
  96. FILES_CMAKE
  97. gradientsignal_editor_shared_files.cmake
  98. INCLUDE_DIRECTORIES
  99. PRIVATE
  100. Source
  101. PUBLIC
  102. Include
  103. BUILD_DEPENDENCIES
  104. PRIVATE
  105. Gem::${gem_name}.Editor.Static
  106. RUNTIME_DEPENDENCIES
  107. Gem::LmbrCentral.Editor
  108. )
  109. # Inject the gem name into the Module source file
  110. ly_add_source_properties(
  111. SOURCES
  112. Source/GradientSignalEditorModule.cpp
  113. PROPERTY COMPILE_DEFINITIONS
  114. VALUES
  115. O3DE_GEM_NAME=${gem_name}
  116. O3DE_GEM_VERSION=${gem_version})
  117. # Load the "Gem::${gem_name}.Editor" module in Builders and Tools
  118. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  119. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  120. endif()
  121. ################################################################################
  122. # Tests
  123. ################################################################################
  124. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  125. ly_add_target(
  126. NAME ${gem_name}.Mocks HEADERONLY
  127. NAMESPACE Gem
  128. FILES_CMAKE
  129. gradientsignal_mocks_files.cmake
  130. INCLUDE_DIRECTORIES
  131. INTERFACE
  132. Mocks
  133. )
  134. ly_add_target(
  135. NAME ${gem_name}.Tests.Static STATIC
  136. NAMESPACE Gem
  137. FILES_CMAKE
  138. gradientsignal_shared_tests_files.cmake
  139. INCLUDE_DIRECTORIES
  140. PUBLIC
  141. Tests
  142. PRIVATE
  143. .
  144. Source
  145. BUILD_DEPENDENCIES
  146. PRIVATE
  147. AZ::AzTest
  148. AZ::AzTestShared
  149. Gem::Atom_RPI.TestUtils
  150. Gem::${gem_name}.Static
  151. Gem::LmbrCentral
  152. Gem::LmbrCentral.Mocks
  153. Gem::${gem_name}.Mocks
  154. RUNTIME_DEPENDENCIES
  155. Gem::SurfaceData
  156. )
  157. ly_add_target(
  158. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  159. NAMESPACE Gem
  160. FILES_CMAKE
  161. gradientsignal_tests_files.cmake
  162. INCLUDE_DIRECTORIES
  163. PRIVATE
  164. .
  165. Source
  166. BUILD_DEPENDENCIES
  167. PRIVATE
  168. AZ::AzTest
  169. AZ::AzTestShared
  170. Gem::${gem_name}.Tests.Static
  171. Gem::${gem_name}.Static
  172. Gem::LmbrCentral
  173. Gem::LmbrCentral.Mocks
  174. Gem::${gem_name}.Mocks
  175. RUNTIME_DEPENDENCIES
  176. Gem::SurfaceData
  177. )
  178. ly_add_googletest(
  179. NAME Gem::${gem_name}.Tests
  180. LABELS REQUIRES_tiaf
  181. )
  182. ly_add_googlebenchmark(
  183. NAME Gem::${gem_name}.Benchmarks
  184. TARGET Gem::${gem_name}.Tests
  185. )
  186. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  187. ly_add_target(
  188. NAME ${gem_name}.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  189. NAMESPACE Gem
  190. FILES_CMAKE
  191. gradientsignal_editor_tests_files.cmake
  192. PLATFORM_INCLUDE_FILES
  193. Source/Platform/Common/${PAL_TRAIT_COMPILER_ID}/gradient_signal_editor_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
  194. INCLUDE_DIRECTORIES
  195. PRIVATE
  196. .
  197. Source
  198. BUILD_DEPENDENCIES
  199. PRIVATE
  200. 3rdParty::OpenImageIO
  201. AZ::AzTest
  202. AZ::AzTestShared
  203. Gem::${gem_name}.Tests.Static
  204. Gem::${gem_name}.Static
  205. Gem::${gem_name}.Editor.Static
  206. Gem::LmbrCentral.Editor
  207. Gem::LmbrCentral.Mocks
  208. )
  209. ly_add_googletest(
  210. NAME Gem::${gem_name}.Editor.Tests
  211. LABELS REQUIRES_tiaf
  212. )
  213. endif()
  214. endif()