CMakeLists.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. surfacedata_files.cmake
  13. INCLUDE_DIRECTORIES
  14. PRIVATE
  15. Source
  16. PUBLIC
  17. Include
  18. BUILD_DEPENDENCIES
  19. PRIVATE
  20. Gem::LmbrCentral
  21. PUBLIC
  22. AZ::AzCore
  23. AZ::AzFramework
  24. Gem::Atom_RPI.Public
  25. Gem::Atom_Feature_Common.Public
  26. )
  27. ly_add_target(
  28. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  29. NAMESPACE Gem
  30. FILES_CMAKE
  31. surfacedata_shared_files.cmake
  32. INCLUDE_DIRECTORIES
  33. PRIVATE
  34. Source
  35. PUBLIC
  36. Include
  37. BUILD_DEPENDENCIES
  38. PUBLIC
  39. Gem::${gem_name}.Static
  40. Gem::LmbrCentral.API
  41. RUNTIME_DEPENDENCIES
  42. Gem::LmbrCentral
  43. )
  44. # Inject the gem name into the Module source file
  45. ly_add_source_properties(
  46. SOURCES
  47. Source/SurfaceDataModule.cpp
  48. PROPERTY COMPILE_DEFINITIONS
  49. VALUES
  50. O3DE_GEM_NAME=${gem_name}
  51. O3DE_GEM_VERSION=${gem_version})
  52. # the above module is for use in all client/server types
  53. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name})
  54. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  55. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS Gem::${gem_name})
  56. if (PAL_TRAIT_BUILD_HOST_TOOLS)
  57. ly_add_target(
  58. NAME ${gem_name}.Editor GEM_MODULE
  59. NAMESPACE Gem
  60. FILES_CMAKE
  61. surfacedata_editor_files.cmake
  62. COMPILE_DEFINITIONS
  63. PRIVATE
  64. SURFACEDATA_EDITOR
  65. INCLUDE_DIRECTORIES
  66. PRIVATE
  67. Source
  68. PUBLIC
  69. Include
  70. BUILD_DEPENDENCIES
  71. PRIVATE
  72. AZ::AzToolsFramework
  73. Gem::${gem_name}.Static
  74. Gem::LmbrCentral.Editor.Static
  75. RUNTIME_DEPENDENCIES
  76. Gem::LmbrCentral.Editor
  77. )
  78. # Inject the gem name into the Module source file
  79. ly_add_source_properties(
  80. SOURCES
  81. Source/SurfaceDataEditorModule.cpp
  82. PROPERTY COMPILE_DEFINITIONS
  83. VALUES
  84. O3DE_GEM_NAME=${gem_name}
  85. O3DE_GEM_VERSION=${gem_version})
  86. # the above module is for use in dev tool situations
  87. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  88. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  89. endif()
  90. ################################################################################
  91. # Tests
  92. ################################################################################
  93. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  94. ly_add_target(
  95. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  96. NAMESPACE Gem
  97. FILES_CMAKE
  98. surfacedata_tests_files.cmake
  99. INCLUDE_DIRECTORIES
  100. PRIVATE
  101. .
  102. Tests
  103. Source
  104. BUILD_DEPENDENCIES
  105. PRIVATE
  106. AZ::AzTest
  107. Gem::${gem_name}.Static
  108. Gem::LmbrCentral
  109. RUNTIME_DEPENDENCIES
  110. Gem::LmbrCentral
  111. )
  112. ly_add_googletest(
  113. NAME Gem::${gem_name}.Tests
  114. LABELS REQUIRES_tiaf
  115. )
  116. ly_add_googlebenchmark(
  117. NAME Gem::${gem_name}.Benchmarks
  118. TARGET Gem::${gem_name}.Tests
  119. )
  120. endif()