CMakeLists.txt 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 ROSConDemo/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 : ROSConDemo/Code/Platform/<platform_name> or
  9. # <restricted_folder>/<platform_name>/ROSConDemo/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_ROSCONDEMO_SUPPORTED)
  18. return()
  19. endif()
  20. # We are on a supported platform, so add the ROSConDemo target
  21. # Note: We include the common files and the platform specific files which are set in roscondemo_files.cmake and
  22. # in ${pal_dir}/roscondemo_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  23. ly_add_target(
  24. NAME ROSConDemo.Static STATIC
  25. NAMESPACE Gem
  26. FILES_CMAKE
  27. roscondemo_files.cmake
  28. ${pal_dir}/roscondemo_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  29. PLATFORM_INCLUDE_FILES
  30. ${CMAKE_CURRENT_LIST_DIR}/Platform/Common/${PAL_TRAIT_COMPILER_ID}/exceptions_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake
  31. INCLUDE_DIRECTORIES
  32. PUBLIC
  33. Include
  34. PRIVATE
  35. Source
  36. BUILD_DEPENDENCIES
  37. # PUBLIC
  38. # Gem::ROS2.Static
  39. PRIVATE
  40. AZ::AzGameFramework
  41. AZ::AzFramework
  42. Gem::EMotionFX.Static
  43. Gem::LmbrCentral.API
  44. Gem::LyShine
  45. Gem::AtomLyIntegration_CommonFeatures.Editor.Static
  46. Gem::Atom_AtomBridge.Static
  47. )
  48. target_depends_on_ros2_packages(ROSConDemo.Static std_srvs nav_msgs vision_msgs)
  49. ly_add_target(
  50. NAME ROSConDemo ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  51. NAMESPACE Gem
  52. FILES_CMAKE
  53. roscondemo_shared_files.cmake
  54. ${pal_dir}/roscondemo_shared_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  55. INCLUDE_DIRECTORIES
  56. PUBLIC
  57. Include
  58. BUILD_DEPENDENCIES
  59. PRIVATE
  60. Gem::ROSConDemo.Static
  61. AZ::AzCore
  62. AZ::AzFramework
  63. )
  64. # if enabled, ROSConDemo is used by all kinds of applications
  65. ly_create_alias(NAME ROSConDemo.Builders NAMESPACE Gem TARGETS Gem::ROSConDemo)
  66. ly_create_alias(NAME ROSConDemo.Tools NAMESPACE Gem TARGETS Gem::ROSConDemo)
  67. ly_create_alias(NAME ROSConDemo.Clients NAMESPACE Gem TARGETS Gem::ROSConDemo)
  68. ly_create_alias(NAME ROSConDemo.Servers NAMESPACE Gem TARGETS Gem::ROSConDemo)
  69. ################################################################################
  70. # Gem dependencies
  71. ################################################################################
  72. # Enable the specified list of gems from GEM_FILE or GEMS list for this specific project:
  73. ly_enable_gems(PROJECT_NAME ROSConDemo GEM_FILE enabled_gems.cmake)