CMakeLists.txt 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. INCLUDE_DIRECTORIES
  30. PUBLIC
  31. Include
  32. BUILD_DEPENDENCIES
  33. PRIVATE
  34. AZ::AzGameFramework
  35. Gem::Atom_AtomBridge.Static
  36. )
  37. #target_depends_on_ros2_packages(ROSConDemo.Static vision_msgs)
  38. ly_add_target(
  39. NAME ROSConDemo ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  40. NAMESPACE Gem
  41. FILES_CMAKE
  42. roscondemo_shared_files.cmake
  43. ${pal_dir}/roscondemo_shared_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  44. INCLUDE_DIRECTORIES
  45. PUBLIC
  46. Include
  47. BUILD_DEPENDENCIES
  48. PRIVATE
  49. Gem::ROSConDemo.Static
  50. AZ::AzCore
  51. )
  52. # if enabled, ROSConDemo is used by all kinds of applications
  53. ly_create_alias(NAME ROSConDemo.Builders NAMESPACE Gem TARGETS Gem::ROSConDemo)
  54. ly_create_alias(NAME ROSConDemo.Tools NAMESPACE Gem TARGETS Gem::ROSConDemo)
  55. ly_create_alias(NAME ROSConDemo.Clients NAMESPACE Gem TARGETS Gem::ROSConDemo)
  56. ly_create_alias(NAME ROSConDemo.Servers NAMESPACE Gem TARGETS Gem::ROSConDemo)
  57. ################################################################################
  58. # Gem dependencies
  59. ################################################################################
  60. # Enable the specified list of gems from GEM_FILE or GEMS list for this specific project:
  61. ly_enable_gems(PROJECT_NAME ROSConDemo GEM_FILE enabled_gems.cmake)