CMakeLists.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}")
  9. set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common)
  10. ly_add_target(
  11. NAME ${gem_name}.Static STATIC
  12. NAMESPACE Gem
  13. FILES_CMAKE
  14. lmbrcentral_headers_files.cmake
  15. lmbrcentral_files.cmake
  16. ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  17. INCLUDE_DIRECTORIES
  18. PRIVATE
  19. Source
  20. ${pal_dir}
  21. PUBLIC
  22. include
  23. BUILD_DEPENDENCIES
  24. PRIVATE
  25. Legacy::CryCommon
  26. AZ::AzFramework
  27. PUBLIC
  28. Gem::AudioSystem.API
  29. )
  30. ly_add_target(
  31. NAME ${gem_name}.API HEADERONLY
  32. NAMESPACE Gem
  33. FILES_CMAKE
  34. lmbrcentral_headers_files.cmake
  35. INCLUDE_DIRECTORIES
  36. INTERFACE
  37. include
  38. )
  39. ly_add_target(
  40. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  41. NAMESPACE Gem
  42. FILES_CMAKE
  43. lmbrcentral_shared_files.cmake
  44. INCLUDE_DIRECTORIES
  45. PRIVATE
  46. Source
  47. ${pal_dir}
  48. PUBLIC
  49. include
  50. BUILD_DEPENDENCIES
  51. PRIVATE
  52. Legacy::CryCommon
  53. AZ::AzFramework
  54. Gem::${gem_name}.Static
  55. )
  56. # Inject the gem name into the Module source file
  57. ly_add_source_properties(
  58. SOURCES
  59. Source/LmbrCentral.cpp
  60. PROPERTY COMPILE_DEFINITIONS
  61. VALUES
  62. O3DE_GEM_NAME=${gem_name}
  63. O3DE_GEM_VERSION=${gem_version})
  64. # by default, load the above "Gem::${gem_name}" module in Client and Server
  65. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  66. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name})
  67. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS Gem::${gem_name})
  68. if (PAL_TRAIT_BUILD_HOST_TOOLS)
  69. ly_add_target(
  70. NAME ${gem_name}.Editor.Static STATIC
  71. NAMESPACE Gem
  72. FILES_CMAKE
  73. lmbrcentral_editor_files.cmake
  74. INCLUDE_DIRECTORIES
  75. PRIVATE
  76. Source
  77. ${pal_dir}
  78. PUBLIC
  79. include
  80. COMPILE_DEFINITIONS
  81. PUBLIC
  82. LMBR_CENTRAL_EDITOR
  83. BUILD_DEPENDENCIES
  84. PRIVATE
  85. ${additional_dependencies}
  86. PUBLIC
  87. 3rdParty::Qt::Widgets
  88. Legacy::CryCommon
  89. Legacy::Editor.Headers
  90. AZ::AzToolsFramework
  91. AZ::AssetBuilderSDK
  92. Gem::AudioSystem.API
  93. )
  94. ly_add_target(
  95. NAME ${gem_name}.Editor GEM_MODULE
  96. NAMESPACE Gem
  97. FILES_CMAKE
  98. lmbrcentral_editor_shared_files.cmake
  99. INCLUDE_DIRECTORIES
  100. PRIVATE
  101. Source
  102. ${pal_dir}
  103. PUBLIC
  104. include
  105. BUILD_DEPENDENCIES
  106. PRIVATE
  107. 3rdParty::Qt::Gui
  108. AZ::AzCore
  109. Gem::${gem_name}.Static
  110. Gem::${gem_name}.Editor.Static
  111. ${additional_dependencies}
  112. )
  113. # Inject the gem name into the Module source file
  114. ly_add_source_properties(
  115. SOURCES
  116. Source/LmbrCentralEditor.cpp
  117. PROPERTY COMPILE_DEFINITIONS
  118. VALUES
  119. O3DE_GEM_NAME=${gem_name}
  120. O3DE_GEM_VERSION=${gem_version})
  121. include(${pal_dir}/lrelease_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
  122. ly_add_target_files(
  123. TARGETS ${gem_name}.Editor
  124. FILES ${lrelease_files}
  125. )
  126. # by default, load the above "Gem::${gem_name}.Editor" module in dev tools
  127. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  128. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  129. endif()
  130. add_subdirectory(Tests)