CMakeLists.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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_gem_setup("PhysXDebug")
  9. ly_add_external_target_path(${CMAKE_CURRENT_SOURCE_DIR}/3rdParty)
  10. # This gem relies on the PhysX gem
  11. o3de_find_gem("PhysX5" physx_gem_path)
  12. set(physx_gem_json ${physx_gem_path}/gem.json)
  13. o3de_restricted_path(${physx_gem_json} physx_gem_restricted_path physx_gem_parent_relative_path)
  14. o3de_pal_dir(physx_pal_source_dir ${physx_gem_path}/Source/Platform/${PAL_PLATFORM_NAME} "${physx_gem_restricted_path}" "${physx_gem_path}" "${physx_gem_parent_relative_path}")
  15. include(${physx_pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_PHYSX_SUPPORTED
  16. if(PAL_TRAIT_PHYSX_SUPPORTED)
  17. set(physxdebug_dependency 3rdParty::PhysX5)
  18. set(physxdebug_files ../Code/physxdebug_files.cmake)
  19. set(physxdebug_module_files physxdebug_module_files.cmake)
  20. set(physxdebug_editor_files ../Code/physxdebug_editor_files.cmake)
  21. else()
  22. set(physxdebug_files ../Code/physxdebug_unsupported_files.cmake)
  23. set(physxdebug_module_files physxdebug_unsupported_module_files.cmake)
  24. set(physxdebug_editor_files ../Code/physxdebug_unsupported_files.cmake)
  25. endif()
  26. ########################################################################################
  27. ly_add_target(
  28. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  29. NAMESPACE Gem
  30. OUTPUT_NAME ${gem_name}.Gem
  31. FILES_CMAKE
  32. ${physxdebug_module_files}
  33. ${physxdebug_files}
  34. INCLUDE_DIRECTORIES
  35. PRIVATE
  36. ../Code/Source
  37. PUBLIC
  38. ../Code/Include
  39. BUILD_DEPENDENCIES
  40. PUBLIC
  41. ${physxdebug_dependency}
  42. Legacy::CryCommon
  43. Gem::PhysX5
  44. Gem::ImGui.imguilib
  45. Gem::ImGui
  46. RUNTIME_DEPENDENCIES
  47. Gem::PhysX5
  48. Gem::ImGui
  49. )
  50. ########################################################################################
  51. # Inject the gem name into the Module source file
  52. if (PAL_TRAIT_PHYSX_SUPPORTED)
  53. ly_add_source_properties(
  54. SOURCES
  55. Source/Module.cpp
  56. PROPERTY COMPILE_DEFINITIONS
  57. VALUES
  58. O3DE_GEM_NAME=${gem_name}
  59. O3DE_GEM_VERSION=${gem_version})
  60. else()
  61. ly_add_source_properties(
  62. SOURCES
  63. Source/ModuleUnsupported.cpp
  64. PROPERTY COMPILE_DEFINITIONS
  65. VALUES
  66. O3DE_GEM_NAME=${gem_name}
  67. O3DE_GEM_VERSION=${gem_version})
  68. endif()
  69. # use the ${gem_name} module in Clients and Servers:
  70. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  71. ly_create_alias(NAME ${gem_name}.Servers NAMESPACE Gem TARGETS Gem::${gem_name})
  72. ly_create_alias(NAME ${gem_name}.Unified NAMESPACE Gem TARGETS Gem::${gem_name})
  73. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  74. ########################################################################################
  75. ly_add_target(
  76. NAME ${gem_name}.Editor GEM_MODULE
  77. NAMESPACE Gem
  78. OUTPUT_NAME ${gem_name}.Editor.Gem
  79. FILES_CMAKE
  80. ${physxdebug_module_files}
  81. ${physxdebug_editor_files}
  82. COMPILE_DEFINITIONS
  83. PRIVATE
  84. PHYSXDEBUG_GEM_EDITOR
  85. INCLUDE_DIRECTORIES
  86. PRIVATE
  87. ../Code/Source
  88. PUBLIC
  89. ../Code/Include
  90. BUILD_DEPENDENCIES
  91. PRIVATE
  92. ${physxdebug_dependency}
  93. Legacy::CryCommon
  94. Legacy::Editor.Headers
  95. AZ::AzToolsFramework
  96. Gem::PhysX5.Editor
  97. Gem::ImGui.imguilib
  98. Gem::ImGui.Editor
  99. RUNTIME_DEPENDENCIES
  100. Gem::PhysX5.Editor
  101. Gem::ImGui.Editor
  102. )
  103. # use the ${gem_name}.Editor module in dev tools:
  104. ly_create_alias(NAME ${gem_name}.Builders NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  105. ly_create_alias(NAME ${gem_name}.Tools NAMESPACE Gem TARGETS Gem::${gem_name}.Editor)
  106. endif()