CMakeLists.txt 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. stars_files.cmake
  13. INCLUDE_DIRECTORIES
  14. PUBLIC
  15. Include
  16. PRIVATE
  17. Source
  18. BUILD_DEPENDENCIES
  19. PUBLIC
  20. AZ::AzCore
  21. AZ::AzFramework
  22. Gem::Atom_RHI.Public
  23. Gem::Atom_RPI.Public
  24. Gem::Atom_Utils.Static
  25. )
  26. ly_add_target(
  27. NAME ${gem_name}.API HEADERONLY
  28. NAMESPACE Gem
  29. FILES_CMAKE
  30. stars_headers_files.cmake
  31. INCLUDE_DIRECTORIES
  32. INTERFACE
  33. include
  34. )
  35. ly_add_target(
  36. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  37. NAMESPACE Gem
  38. FILES_CMAKE
  39. stars_shared_files.cmake
  40. INCLUDE_DIRECTORIES
  41. PUBLIC
  42. Include
  43. PRIVATE
  44. Source
  45. BUILD_DEPENDENCIES
  46. PRIVATE
  47. Gem::${gem_name}.Static
  48. )
  49. # Inject the gem name into the Module source file
  50. ly_add_source_properties(
  51. SOURCES
  52. Source/StarsModule.cpp
  53. PROPERTY COMPILE_DEFINITIONS
  54. VALUES
  55. O3DE_GEM_NAME=${gem_name}
  56. O3DE_GEM_VERSION=${gem_version})
  57. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  58. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  59. ly_add_target(
  60. NAME ${gem_name}.Editor.Static STATIC
  61. NAMESPACE Gem
  62. FILES_CMAKE
  63. stars_editor_files.cmake
  64. INCLUDE_DIRECTORIES
  65. PRIVATE
  66. Source
  67. PUBLIC
  68. Include
  69. BUILD_DEPENDENCIES
  70. PUBLIC
  71. AZ::AzToolsFramework
  72. Gem::${gem_name}.Static
  73. Gem::Atom_Feature_Common.Public
  74. )
  75. ly_add_target(
  76. NAME ${gem_name}.Editor GEM_MODULE
  77. NAMESPACE Gem
  78. AUTOMOC
  79. FILES_CMAKE
  80. stars_editor_shared_files.cmake
  81. INCLUDE_DIRECTORIES
  82. PRIVATE
  83. Source
  84. PUBLIC
  85. Include
  86. BUILD_DEPENDENCIES
  87. PUBLIC
  88. Gem::${gem_name}.Editor.Static
  89. )
  90. # Inject the gem name into the Module source file
  91. ly_add_source_properties(
  92. SOURCES
  93. Source/EditorStarsModule.cpp
  94. PROPERTY COMPILE_DEFINITIONS
  95. VALUES
  96. O3DE_GEM_NAME=${gem_name}
  97. O3DE_GEM_VERSION=${gem_version})
  98. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  99. # A Builders alias must exist for Gem Assets to be seen by the Asset Processor.
  100. # A Builders alias target must exist for the Prefab .spawnable builder to be able to
  101. # load the .dll so the builder can serialize StarComponents to .spawnable files
  102. # which are needed in the game launcher.
  103. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  104. endif()