CMakeLists.txt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  10. NAMESPACE Gem
  11. FILES_CMAKE
  12. customassetexample_shared_files.cmake
  13. INCLUDE_DIRECTORIES
  14. PRIVATE
  15. Source
  16. BUILD_DEPENDENCIES
  17. PRIVATE
  18. AZ::AzCore
  19. )
  20. # Inject the gem name into the Module source file
  21. ly_add_source_properties(
  22. SOURCES
  23. Source/CustomAssetExample/CustomAssetExampleModule.cpp
  24. PROPERTY COMPILE_DEFINITIONS
  25. VALUES
  26. O3DE_GEM_NAME=${gem_name}
  27. O3DE_GEM_VERSION=${gem_version})
  28. # clients and servers use the above module.
  29. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS ${gem_name})
  30. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS ${gem_name})
  31. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS ${gem_name})
  32. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  33. ly_add_target(
  34. NAME ${gem_name}.Editor GEM_MODULE
  35. NAMESPACE Gem
  36. FILES_CMAKE
  37. customassetexample_editor_files.cmake
  38. INCLUDE_DIRECTORIES
  39. PRIVATE
  40. Source
  41. BUILD_DEPENDENCIES
  42. PRIVATE
  43. AZ::AzCore
  44. AZ::AssetBuilderSDK
  45. )
  46. # Inject the gem name into the Module source file
  47. ly_add_source_properties(
  48. SOURCES
  49. Source/CustomAssetExample/CustomAssetExampleEditorModule.cpp
  50. PROPERTY COMPILE_DEFINITIONS
  51. VALUES
  52. O3DE_GEM_NAME=${gem_name}
  53. O3DE_GEM_VERSION=${gem_version})
  54. # other tools use the above tools module:
  55. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS ${gem_name}.Editor)
  56. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS ${gem_name}.Editor)
  57. endif()