CMakeLists.txt 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. scriptcanvas_physics_files.cmake
  13. INCLUDE_DIRECTORIES
  14. PRIVATE
  15. Source
  16. BUILD_DEPENDENCIES
  17. PRIVATE
  18. Legacy::CryCommon
  19. PUBLIC
  20. Gem::ScriptCanvas.Extensions
  21. AUTOGEN_RULES
  22. *.ScriptCanvasFunction.xml,ScriptCanvasFunction_Header.jinja,$path/$fileprefix.generated.h
  23. *.ScriptCanvasFunction.xml,ScriptCanvasFunction_Source.jinja,$path/$fileprefix.generated.cpp
  24. )
  25. ly_add_target(
  26. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  27. NAMESPACE Gem
  28. FILES_CMAKE
  29. scriptcanvas_physics_shared_files.cmake
  30. INCLUDE_DIRECTORIES
  31. PRIVATE
  32. Source
  33. BUILD_DEPENDENCIES
  34. PRIVATE
  35. Legacy::CryCommon
  36. Gem::${gem_name}.Static
  37. )
  38. # Inject the gem name into the Module source file
  39. ly_add_source_properties(
  40. SOURCES
  41. Source/ScriptCanvasPhysicsModule.cpp
  42. PROPERTY COMPILE_DEFINITIONS
  43. VALUES
  44. O3DE_GEM_NAME=${gem_name}
  45. O3DE_GEM_VERSION=${gem_version})
  46. # By default, the above module is used by all application types, however, the module depends at runtime to ScriptCanvas
  47. # and the dependency needs to be different per application type
  48. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name} Gem::ScriptCanvas)
  49. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name} Gem::ScriptCanvas)
  50. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS Gem::${gem_name} Gem::ScriptCanvas)
  51. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name} Gem::ScriptCanvas.Editor)
  52. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name} Gem::ScriptCanvas.Editor)
  53. ################################################################################
  54. # Tests
  55. ################################################################################
  56. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  57. ly_add_target(
  58. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  59. NAMESPACE Gem
  60. FILES_CMAKE
  61. scriptcanvas_physics_tests_files.cmake
  62. INCLUDE_DIRECTORIES
  63. PRIVATE
  64. Source
  65. Tests
  66. BUILD_DEPENDENCIES
  67. PRIVATE
  68. AZ::AzFramework
  69. AZ::AzTest
  70. Legacy::CryCommon
  71. Gem::${gem_name}.Static
  72. )
  73. ly_add_googletest(
  74. NAME Gem::${gem_name}.Tests
  75. )
  76. endif()