CMakeLists.txt 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. # The ${gem_name}.API target declares the common interface that users of this gem should depend on in their targets to avoid linking.
  9. ly_add_target(
  10. NAME ${gem_name}.API INTERFACE
  11. NAMESPACE Gem
  12. FILES_CMAKE
  13. debugdraw_api_files.cmake
  14. INCLUDE_DIRECTORIES
  15. INTERFACE
  16. Include
  17. BUILD_DEPENDENCIES
  18. INTERFACE
  19. AZ::AzCore
  20. )
  21. ly_add_target(
  22. NAME ${gem_name}.Static STATIC
  23. NAMESPACE Gem
  24. FILES_CMAKE
  25. debugdraw_files.cmake
  26. INCLUDE_DIRECTORIES
  27. PRIVATE
  28. Source
  29. PUBLIC
  30. Include
  31. BUILD_DEPENDENCIES
  32. PUBLIC
  33. AZ::AtomCore
  34. Gem::Atom_RPI.Public
  35. Gem::Atom_Bootstrap.Headers
  36. Gem::Atom_Feature_Common.Static
  37. Legacy::CryCommon
  38. )
  39. ly_add_target(
  40. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  41. NAMESPACE Gem
  42. FILES_CMAKE
  43. debugdraw_shared_files.cmake
  44. ../Assets/debugdraw_asset_files.cmake
  45. INCLUDE_DIRECTORIES
  46. PRIVATE
  47. Source
  48. PUBLIC
  49. Include
  50. BUILD_DEPENDENCIES
  51. PRIVATE
  52. Gem::${gem_name}.Static
  53. )
  54. # Inject the gem name into the Module source file
  55. ly_add_source_properties(
  56. SOURCES
  57. Source/DebugDrawModule.cpp
  58. PROPERTY COMPILE_DEFINITIONS
  59. VALUES
  60. O3DE_GEM_NAME=${gem_name}
  61. O3DE_GEM_VERSION=${gem_version})
  62. # servers do not need debug draw components, only clients
  63. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS ${gem_name})
  64. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS ${gem_name})
  65. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  66. ly_add_target(
  67. NAME ${gem_name}.Editor GEM_MODULE
  68. NAMESPACE Gem
  69. FILES_CMAKE
  70. debugdraw_editor_files.cmake
  71. INCLUDE_DIRECTORIES
  72. PRIVATE
  73. Source
  74. PUBLIC
  75. Include
  76. COMPILE_DEFINITIONS
  77. PRIVATE
  78. DEBUGDRAW_GEM_EDITOR=1
  79. BUILD_DEPENDENCIES
  80. PRIVATE
  81. AZ::AtomCore
  82. Gem::Atom_RPI.Public
  83. Gem::Atom_Bootstrap.Headers
  84. Gem::Atom_Feature_Common.Static
  85. Legacy::CryCommon
  86. AZ::AzToolsFramework
  87. )
  88. # builders and tools use ${gem_name}.Editor
  89. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS ${gem_name}.Editor)
  90. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS ${gem_name}.Editor)
  91. endif()