CMakeLists.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  9. ly_add_target(
  10. NAME ${gem_name}.Editor.Static STATIC
  11. NAMESPACE Gem
  12. FILES_CMAKE
  13. graphmodel_editor_static_files.cmake
  14. COMPILE_DEFINITIONS
  15. PRIVATE
  16. GRAPHMODEL_EDITOR
  17. INCLUDE_DIRECTORIES
  18. PRIVATE
  19. Source
  20. PUBLIC
  21. Include
  22. BUILD_DEPENDENCIES
  23. PRIVATE
  24. AZ::AzCore
  25. AZ::AzFramework
  26. AZ::AzToolsFramework
  27. Gem::GraphCanvasWidgets
  28. )
  29. ly_add_target(
  30. NAME ${gem_name}.Editor GEM_MODULE
  31. NAMESPACE Gem
  32. FILES_CMAKE
  33. graphmodel_editor_files.cmake
  34. COMPILE_DEFINITIONS
  35. PRIVATE
  36. GRAPHMODEL_EDITOR
  37. INCLUDE_DIRECTORIES
  38. PRIVATE
  39. Source
  40. BUILD_DEPENDENCIES
  41. PRIVATE
  42. AZ::AzCore
  43. AZ::AzFramework
  44. AZ::AzToolsFramework
  45. Gem::GraphCanvasWidgets
  46. Gem::${gem_name}.Editor.Static
  47. RUNTIME_DEPENDENCIES
  48. Gem::GraphCanvas.Editor
  49. )
  50. # Inject the gem name into the Module source file
  51. ly_add_source_properties(
  52. SOURCES
  53. Source/GraphModelModule.cpp
  54. PROPERTY COMPILE_DEFINITIONS
  55. VALUES
  56. O3DE_GEM_NAME=${gem_name}
  57. O3DE_GEM_VERSION=${gem_version})
  58. # Load the "Gem::${gem_name}" module in Builders and Tools
  59. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  60. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  61. endif()
  62. ################################################################################
  63. # Tests
  64. ################################################################################
  65. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  66. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  67. ly_add_target(
  68. NAME ${gem_name}.Editor.Tests MODULE
  69. NAMESPACE Gem
  70. FILES_CMAKE
  71. graphmodel_tests_editor_files.cmake
  72. COMPILE_DEFINITIONS
  73. PRIVATE
  74. GRAPHMODEL_EDITOR
  75. INCLUDE_DIRECTORIES
  76. PRIVATE
  77. .
  78. Tests
  79. Source
  80. BUILD_DEPENDENCIES
  81. PRIVATE
  82. AZ::AzTest
  83. AZ::AzFramework
  84. AZ::AzToolsFramework
  85. Gem::GraphCanvasWidgets
  86. Gem::${gem_name}.Editor.Static
  87. )
  88. ly_add_googletest(
  89. NAME Gem::${gem_name}.Editor.Tests
  90. LABELS REQUIRES_tiaf
  91. )
  92. endif()
  93. endif()