CMakeLists.txt 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. scriptevents_common_files.cmake
  13. INCLUDE_DIRECTORIES
  14. PUBLIC
  15. Include
  16. PRIVATE
  17. Source
  18. BUILD_DEPENDENCIES
  19. PRIVATE
  20. AZ::AzCore
  21. AZ::AzFramework
  22. )
  23. ly_add_target(
  24. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  25. NAMESPACE Gem
  26. FILES_CMAKE
  27. scriptevents_files.cmake
  28. INCLUDE_DIRECTORIES
  29. PRIVATE
  30. Source
  31. BUILD_DEPENDENCIES
  32. PRIVATE
  33. AZ::AzCore
  34. AZ::AzFramework
  35. Gem::${gem_name}.Static
  36. )
  37. # Inject the gem name into the Module source file
  38. ly_add_source_properties(
  39. SOURCES
  40. Source/ScriptEventsGem.cpp
  41. PROPERTY COMPILE_DEFINITIONS
  42. VALUES
  43. O3DE_GEM_NAME=${gem_name}
  44. O3DE_GEM_VERSION=${gem_version})
  45. # the above module is for use in clients and servers
  46. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  47. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name})
  48. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS Gem::${gem_name})
  49. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  50. ly_add_target(
  51. NAME ${gem_name}.Editor GEM_MODULE
  52. NAMESPACE Gem
  53. FILES_CMAKE
  54. scriptevents_editor_files.cmake
  55. scriptevents_editor_builder_files.cmake
  56. COMPILE_DEFINITIONS
  57. PRIVATE
  58. SCRIPTEVENTS_EDITOR
  59. INCLUDE_DIRECTORIES
  60. PRIVATE
  61. .
  62. Source
  63. BUILD_DEPENDENCIES
  64. PRIVATE
  65. AZ::AzCore
  66. AZ::AssetBuilderSDK
  67. Gem::${gem_name}.Static
  68. )
  69. # Inject the gem name into the Module source file
  70. ly_add_source_properties(
  71. SOURCES
  72. Source/Editor/ScriptEventsEditorGem.cpp
  73. PROPERTY COMPILE_DEFINITIONS
  74. VALUES
  75. O3DE_GEM_NAME=${gem_name}
  76. O3DE_GEM_VERSION=${gem_version})
  77. # the above module is for use in dev tools.
  78. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  79. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  80. endif()
  81. ################################################################################
  82. # Tests
  83. ################################################################################
  84. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  85. ly_add_target(
  86. NAME ${gem_name}.Tests MODULE
  87. NAMESPACE Gem
  88. FILES_CMAKE
  89. scriptevents_files.cmake
  90. scriptevents_tests_files.cmake
  91. INCLUDE_DIRECTORIES
  92. PRIVATE
  93. .
  94. Include/${gem_name}
  95. Source
  96. Tests
  97. BUILD_DEPENDENCIES
  98. PRIVATE
  99. AZ::AzTest
  100. AZ::AzFramework
  101. Gem::${gem_name}.Static
  102. )
  103. ly_add_googletest(
  104. NAME Gem::${gem_name}.Tests
  105. LABELS REQUIRES_tiaf
  106. )
  107. endif()