CMakeLists.txt 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  11. NAMESPACE Gem
  12. FILES_CMAKE
  13. ${gem_name}_game_files.cmake
  14. INCLUDE_DIRECTORIES
  15. PRIVATE
  16. Source
  17. .
  18. BUILD_DEPENDENCIES
  19. PRIVATE
  20. AZ::AzCore
  21. )
  22. # Inject the gem name into the Module source file
  23. ly_add_source_properties(
  24. SOURCES
  25. Source/GraphCanvasGameModule.cpp
  26. PROPERTY COMPILE_DEFINITIONS
  27. VALUES
  28. O3DE_GEM_NAME=${gem_name}
  29. O3DE_GEM_VERSION=${gem_version})
  30. ly_add_target(
  31. NAME ${gem_name}Widgets STATIC
  32. NAMESPACE Gem
  33. AUTOMOC
  34. AUTOUIC
  35. AUTORCC
  36. FILES_CMAKE
  37. graphcanvas_staticlib_files.cmake
  38. INCLUDE_DIRECTORIES
  39. PUBLIC
  40. .
  41. Source
  42. StaticLib
  43. COMPILE_DEFINITIONS
  44. PUBLIC
  45. GRAPH_CANVAS_ENABLE_DETAILED_PROFILING=0
  46. BUILD_DEPENDENCIES
  47. PRIVATE
  48. AZ::AzCore
  49. AZ::AzFramework
  50. AZ::AzToolsFramework
  51. AZ::AssetBuilderSDK
  52. 3rdParty::Qt::Core
  53. 3rdParty::Qt::Gui
  54. 3rdParty::Qt::Widgets
  55. )
  56. ly_add_target(
  57. NAME ${gem_name}.Editor GEM_MODULE
  58. NAMESPACE Gem
  59. AUTOMOC
  60. AUTORCC
  61. FILES_CMAKE
  62. graphcanvas_files.cmake
  63. INCLUDE_DIRECTORIES
  64. PRIVATE
  65. Include
  66. Source
  67. BUILD_DEPENDENCIES
  68. PRIVATE
  69. AZ::AzCore
  70. AZ::AzFramework
  71. AZ::AzToolsFramework
  72. AZ::AssetBuilderSDK
  73. 3rdParty::Qt::Core
  74. 3rdParty::Qt::Gui
  75. 3rdParty::Qt::Widgets
  76. Gem::${gem_name}Widgets
  77. RUNTIME_DEPENDENCIES
  78. 3rdParty::Qt::Xml
  79. AZ::AzQtComponents
  80. )
  81. # Inject the gem name into the Module source file
  82. ly_add_source_properties(
  83. SOURCES
  84. Source/GraphCanvasEditorModule.cpp
  85. PROPERTY COMPILE_DEFINITIONS
  86. VALUES
  87. O3DE_GEM_NAME=${gem_name}
  88. O3DE_GEM_VERSION=${gem_version})
  89. # Load the "Gem::${gem_name}" module in Builders and Tools
  90. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  91. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  92. endif()
  93. ################################################################################
  94. # Tests
  95. ################################################################################
  96. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  97. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  98. ly_add_target(
  99. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  100. NAMESPACE Gem
  101. FILES_CMAKE
  102. graphcanvas_tests_files.cmake
  103. INCLUDE_DIRECTORIES
  104. PRIVATE
  105. Tests
  106. Source
  107. BUILD_DEPENDENCIES
  108. PRIVATE
  109. AZ::AzTest
  110. Gem::${gem_name}Widgets
  111. )
  112. ly_add_googletest(
  113. NAME Gem::${gem_name}.Tests
  114. LABELS REQUIRES_tiaf
  115. )
  116. endif()
  117. endif()