CMakeLists.txt 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. # Queries the "gem_name" "version" values from the gem.json file for this gem
  9. # They are set in the ${gem_name} and ${gem_version} variables
  10. o3de_gem_setup("${Name}")
  11. if(NOT PAL_TRAIT_BUILD_HOST_TOOLS)
  12. return()
  13. endif()
  14. ly_add_target(
  15. NAME ${gem_name}.Static STATIC
  16. NAMESPACE Gem
  17. INCLUDE_DIRECTORIES
  18. PRIVATE
  19. .
  20. FILES_CMAKE
  21. prefabbuilder_files.cmake
  22. BUILD_DEPENDENCIES
  23. PUBLIC
  24. AZ::AzCore
  25. AZ::AzToolsFramework
  26. AZ::AssetBuilderSDK
  27. AZ::SceneCore
  28. AZ::SceneData
  29. 3rdParty::RapidJSON
  30. )
  31. ly_add_target(
  32. NAME ${gem_name}.Builders GEM_MODULE
  33. NAMESPACE Gem
  34. INCLUDE_DIRECTORIES
  35. PRIVATE
  36. .
  37. FILES_CMAKE
  38. prefabbuilder_module_files.cmake
  39. BUILD_DEPENDENCIES
  40. PRIVATE
  41. Gem::${gem_name}.Static
  42. )
  43. # Inject the gem name into the Module source file
  44. ly_add_source_properties(
  45. SOURCES
  46. PrefabBuilderModule.cpp
  47. PROPERTY COMPILE_DEFINITIONS
  48. VALUES
  49. O3DE_GEM_NAME=${gem_name}
  50. O3DE_GEM_VERSION=${gem_version})
  51. # create an alias for the tool version
  52. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Builders)
  53. # we automatically add this gem, if it is present, to all our known set of builder applications:
  54. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  55. ly_add_target(
  56. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  57. NAMESPACE Gem
  58. FILES_CMAKE
  59. prefabbuilder_tests_files.cmake
  60. INCLUDE_DIRECTORIES
  61. PRIVATE
  62. .
  63. BUILD_DEPENDENCIES
  64. PRIVATE
  65. AZ::AzTest
  66. AZ::AzToolsFrameworkTestCommon
  67. Gem::${gem_name}.Static
  68. )
  69. ly_add_googletest(
  70. NAME Gem::${gem_name}.Tests
  71. LABELS REQUIRES_tiaf
  72. )
  73. endif()