CMakeLists.txt 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. vegetation_files.cmake
  13. COMPILE_DEFINITIONS
  14. PUBLIC
  15. # if we are in debug or profile, enable VEG_PROFILE_ENABLED
  16. $<$<IN_LIST:$<CONFIG>,debug;profile>:VEG_PROFILE_ENABLED>
  17. INCLUDE_DIRECTORIES
  18. PRIVATE
  19. Source
  20. PUBLIC
  21. Include
  22. BUILD_DEPENDENCIES
  23. PRIVATE
  24. Gem::LmbrCentral.API
  25. Gem::SurfaceData.Static
  26. Legacy::CryCommon
  27. PUBLIC
  28. Gem::CommonFeaturesAtom.Static
  29. )
  30. ly_add_target(
  31. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  32. NAMESPACE Gem
  33. FILES_CMAKE
  34. vegetation_shared_files.cmake
  35. INCLUDE_DIRECTORIES
  36. PRIVATE
  37. Source
  38. PUBLIC
  39. Include
  40. BUILD_DEPENDENCIES
  41. PRIVATE
  42. Gem::${gem_name}.Static
  43. Legacy::CryCommon
  44. RUNTIME_DEPENDENCIES
  45. Gem::LmbrCentral
  46. Gem::GradientSignal
  47. Gem::SurfaceData
  48. )
  49. # Inject the gem name into the Module source file
  50. ly_add_source_properties(
  51. SOURCES
  52. Source/VegetationModule.cpp
  53. PROPERTY COMPILE_DEFINITIONS
  54. VALUES
  55. O3DE_GEM_NAME=${gem_name}
  56. O3DE_GEM_VERSION=${gem_version})
  57. # the above module is for use in clients and server type applications
  58. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name})
  59. ly_create_alias(NAME ${gem_name}.Clients 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 GEM_MODULE
  64. NAMESPACE Gem
  65. FILES_CMAKE
  66. vegetation_editor_files.cmake
  67. COMPILE_DEFINITIONS
  68. PRIVATE
  69. VEGETATION_EDITOR
  70. INCLUDE_DIRECTORIES
  71. PRIVATE
  72. Source
  73. PUBLIC
  74. Include
  75. BUILD_DEPENDENCIES
  76. PRIVATE
  77. Gem::${gem_name}.Static
  78. AZ::AzToolsFramework
  79. Legacy::CryCommon
  80. RUNTIME_DEPENDENCIES
  81. Gem::LmbrCentral.Editor
  82. Gem::GradientSignal.Editor
  83. Gem::SurfaceData.Editor
  84. )
  85. # Inject the gem name into the Module source file
  86. ly_add_source_properties(
  87. SOURCES
  88. Source/VegetationEditorModule.cpp
  89. PROPERTY COMPILE_DEFINITIONS
  90. VALUES
  91. O3DE_GEM_NAME=${gem_name}
  92. O3DE_GEM_VERSION=${gem_version})
  93. # the above module is for use 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. endif()
  97. ################################################################################
  98. # Tests
  99. ################################################################################
  100. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  101. ly_add_target(
  102. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  103. NAMESPACE Gem
  104. FILES_CMAKE
  105. vegetation_tests_files.cmake
  106. vegetation_shared_files.cmake
  107. INCLUDE_DIRECTORIES
  108. PRIVATE
  109. Tests
  110. Source
  111. .
  112. BUILD_DEPENDENCIES
  113. PRIVATE
  114. AZ::AzTest
  115. AZ::AzFrameworkTestShared
  116. Gem::${gem_name}.Static
  117. Gem::LmbrCentral.Mocks
  118. Legacy::CryCommon
  119. )
  120. ly_add_googletest(
  121. NAME Gem::${gem_name}.Tests
  122. LABELS REQUIRES_tiaf
  123. )
  124. endif()