Guest User

Untitled

a guest
Mar 14th, 2019
98
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cmake_minimum_required(VERSION 3.5)
  2. project(ros2gui)
  3.  
  4. find_package(ament_cmake REQUIRED)
  5. find_package(rclcpp REQUIRED)
  6. find_package(std_msgs REQUIRED)
  7. find_package(Qt5 REQUIRED COMPONENTS Widgets)
  8.  
  9. set(CMAKE_AUTOMOC ON)
  10. set(CMAKE_AUTOUIC ON)
  11. set(CMAKE_AUTORCC ON)
  12. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  13.  
  14. include_directories(
  15. ${rclcpp_INCLUDE_DIRS}
  16. ${std_msgs_INCLUDE_DIRS}
  17. ${Qt5Core_INCLUDE_DIRS}
  18. ${Qt5Gui_INCLUDE_DIRS}
  19. ${Qt5Widgets_INCLUDE_DIRS}
  20. )
  21.  
  22.  
  23.  
  24. include_directories(src_publisher)
  25. include_directories(src_subscriber)
  26.  
  27. ## Publisher Exe erstellen ##
  28.  
  29. #file(GLOB PUBLISHER_SOURCE
  30. # “src_publisher/*.cpp”
  31. #)
  32.  
  33. set(PUBLISHER_SOURCE
  34. publisher/main.cpp
  35. publisher/publishergui.cpp
  36. publisher/publishergui.ui
  37. publisher/Talker.cpp
  38. )
  39.  
  40. add_executable("publisher" ${PUBLISHER_SOURCE})
  41.  
  42. ament_target_dependencies("publisher"
  43. "rclcpp"
  44. "std_msgs"
  45. )
  46.  
  47. target_link_libraries("publisher"
  48. Qt5::Widgets
  49. )
  50.  
  51. install(TARGETS "publisher" DESTINATION lib/${PROJECT_NAME})
  52.  
  53.  
  54. ## Subscriber Exe erstellen ##
  55.  
  56. #include_directories(src_subscriber)
  57. set(SUBSCRIBER_SOURCE
  58. subscriber/main.cpp
  59. subscriber/subscribergui.cpp
  60. subscriber/subscribergui.ui
  61. subscriber/Listener.cpp
  62. )
  63. add_executable("subscriber" ${SUBSCRIBER_SOURCE})
  64.  
  65. ament_target_dependencies("subscriber"
  66. "rclcpp"
  67. "std_msgs"
  68. )
  69.  
  70. target_link_libraries("subscriber"
  71. Qt5::Widgets
  72. )
  73.  
  74. install(TARGETS "subscriber" DESTINATION lib/${PROJECT_NAME})
  75.  
  76. ament_package()
RAW Paste Data