CMakeLists.txt 5.6 KB

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