2
0

CMakeLists.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. Gem::ImGui.Static
  48. Gem::PhysX.Static
  49. )
  50. target_depends_on_ros2_packages(ROSConDemo.Static std_srvs nav_msgs vision_msgs)
  51. ly_add_target(
  52. NAME ROSConDemo ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  53. NAMESPACE Gem
  54. FILES_CMAKE
  55. roscondemo_shared_files.cmake
  56. ${pal_dir}/roscondemo_shared_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  57. INCLUDE_DIRECTORIES
  58. PUBLIC
  59. Include
  60. BUILD_DEPENDENCIES
  61. PRIVATE
  62. Gem::ROSConDemo.Static
  63. AZ::AzCore
  64. AZ::AzFramework
  65. )
  66. # By default, we will specify that the above target ROSConDemo would be used by
  67. # Client and Server type targets when this gem is enabled. If you don't want it
  68. # active in Clients or Servers by default, delete one or more of the following lines:
  69. ly_create_alias(NAME ROSConDemo.Clients NAMESPACE Gem TARGETS Gem::ROSConDemo)
  70. ly_create_alias(NAME ROSConDemo.Servers NAMESPACE Gem TARGETS Gem::ROSConDemo)
  71. # If we are on a host platform, we want to add the host tools targets like the ROSConDemo.Editor target which
  72. # will also depend on ROSConDemo.Static
  73. if(PAL_TRAIT_BUILD_HOST_TOOLS)
  74. ly_add_target(
  75. NAME ROSConDemo.Editor.Static STATIC
  76. NAMESPACE Gem
  77. AUTOMOC
  78. AUTORCC
  79. FILES_CMAKE
  80. roscondemo_editor_files.cmake
  81. INCLUDE_DIRECTORIES
  82. PRIVATE
  83. Source
  84. PUBLIC
  85. Include
  86. COMPILE_DEFINITIONS
  87. PRIVATE
  88. ROSConDemo_EDITOR
  89. BUILD_DEPENDENCIES
  90. PUBLIC
  91. AZ::AzToolsFramework
  92. Gem::AtomLyIntegration_CommonFeatures.Editor.Static
  93. Gem::LmbrCentral.API
  94. Gem::ROS2.Editor.Static
  95. Gem::ROSConDemo.Static
  96. PRIVATE
  97. )
  98. find_package(urdfdom)
  99. target_link_libraries(ROSConDemo.Editor.Static PUBLIC urdfdom::urdfdom_model)
  100. ly_add_target(
  101. NAME ROSConDemo.Editor GEM_MODULE
  102. NAMESPACE Gem
  103. FILES_CMAKE
  104. roscondemo_editor_shared_files.cmake
  105. COMPILE_DEFINITIONS
  106. PRIVATE
  107. ROSConDemo_EDITOR
  108. INCLUDE_DIRECTORIES
  109. PRIVATE
  110. Source
  111. PUBLIC
  112. Include
  113. BUILD_DEPENDENCIES
  114. PUBLIC
  115. Gem::ROSConDemo.Editor.Static
  116. Gem::Atom_Feature_Common.Static
  117. )
  118. # By default, we will specify that the above target ROSConDemo would be used by
  119. # Tool and Builder type targets when this gem is enabled. If you don't want it
  120. # active in Tools or Builders by default, delete one or both of the following lines:
  121. ly_create_alias(NAME ROSConDemo.Tools NAMESPACE Gem TARGETS Gem::ROSConDemo.Editor)
  122. ly_create_alias(NAME ROSConDemo.Builders NAMESPACE Gem TARGETS Gem::ROSConDemo.Editor)
  123. endif()
  124. ################################################################################
  125. # Gem dependencies
  126. ################################################################################
  127. # Enable the specified list of gems from GEM_FILE or GEMS list for this specific project:
  128. ly_enable_gems(PROJECT_NAME ROSConDemo GEM_FILE enabled_gems.cmake)