CMakeLists.txt 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. set(gem_path ${CMAKE_CURRENT_LIST_DIR})
  2. set(gem_json ${gem_path}/gem.json)
  3. o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path)
  4. # Currently we are in the Physics_Test/Code folder: ${CMAKE_CURRENT_LIST_DIR}
  5. # Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}
  6. # Note: o3de_pal_dir will take care of the details for us, as this may be a restricted platform
  7. # in which case it will see if that platform is present here or in the restricted folder.
  8. # i.e. It could here : Physics_Test/Code/Platform/<platform_name> or
  9. # <restricted_folder>/<platform_name>/Physics_Test/Code
  10. o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path})
  11. # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the
  12. # traits for this platform. Traits for a platform are defines for things like whether or not something in this project
  13. # is supported by this platform.
  14. include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
  15. # Now that we have loaded our project traits for this platform, see if this project is even supported on this platform.
  16. # If its not supported we just return after including the unsupported.
  17. if(NOT PAL_TRAIT_PHYSICS_TEST_SUPPORTED)
  18. return()
  19. endif()
  20. # We are on a supported platform, so add the Physics_Test target
  21. # Note: We include the common files and the platform specific files which are set in physics_test_files.cmake and
  22. # in ${pal_dir}/physics_test_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  23. ly_add_target(
  24. NAME Physics_Test.Static STATIC
  25. NAMESPACE Gem
  26. FILES_CMAKE
  27. physics_test_files.cmake
  28. ${pal_dir}/physics_test_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  29. INCLUDE_DIRECTORIES
  30. PUBLIC
  31. Include
  32. BUILD_DEPENDENCIES
  33. PRIVATE
  34. Gem::PhysX.Static
  35. Gem::ImGui.Static
  36. AZ::AzGameFramework
  37. Gem::Atom_AtomBridge.Static
  38. )
  39. ly_add_target(
  40. NAME Physics_Test ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  41. NAMESPACE Gem
  42. FILES_CMAKE
  43. physics_test_shared_files.cmake
  44. ${pal_dir}/physics_test_shared_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  45. INCLUDE_DIRECTORIES
  46. PUBLIC
  47. Include
  48. BUILD_DEPENDENCIES
  49. PRIVATE
  50. Gem::ImGui.Static
  51. Gem::Physics_Test.Static
  52. AZ::AzCore
  53. )
  54. # if enabled, Physics_Test is used by all kinds of applications
  55. ly_create_alias(NAME Physics_Test.Builders NAMESPACE Gem TARGETS Gem::Physics_Test)
  56. ly_create_alias(NAME Physics_Test.Tools NAMESPACE Gem TARGETS Gem::Physics_Test)
  57. ly_create_alias(NAME Physics_Test.Clients NAMESPACE Gem TARGETS Gem::Physics_Test)
  58. ly_create_alias(NAME Physics_Test.Servers NAMESPACE Gem TARGETS Gem::Physics_Test)
  59. ################################################################################
  60. # Gem dependencies
  61. ################################################################################
  62. # Enable the specified list of gems from GEM_FILE or GEMS list for this specific project:
  63. ly_enable_gems(PROJECT_NAME Physics_Test GEM_FILE enabled_gems.cmake)