cmake_minimum_required(VERSION 3.10) project(rqt_demo_plugin) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() # find dependencies find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(pluginlib REQUIRED) pluginlib_export_plugin_description_file(rqt_gui "plugin.xml") find_package(rqt_gui_cpp REQUIRED) find_package(qt_gui_cpp REQUIRED) find_package(geometry_msgs REQUIRED) find_package(tf2 REQUIRED) find_package(tf2_ros REQUIRED) find_package(tf2_geometry_msgs REQUIRED) find_package(Qt5 COMPONENTS Core REQUIRED) find_package(Qt5 COMPONENTS Widgets REQUIRED) find_package(Qt5 COMPONENTS Svg REQUIRED) find_package(Qt5 COMPONENTS Qml REQUIRED) find_package(Qt5 COMPONENTS Quick REQUIRED) find_package(Qt5 COMPONENTS QuickControls2 REQUIRED) find_package(mg_msgs REQUIRED) find_package(Qt5QuickCompiler) set(CMAKE_AUTOMOC ON) set(QT_QML_GENERATE_QMLLS_INI ON) qt_wrap_cpp( MOC_FILES include/rqt_demo_plugin/rqt_demo_plugin.hpp include/rqt_demo_plugin/lineItem.hpp) qtquick_compiler_add_resources(RCC_SOURCES "resources/res.qrc") add_library( rqt_demo_plugin SHARED src/rqt_demo_plugin.cpp src/lineItem.cpp ${RCC_SOURCES} ${MOC_FILES} ) target_include_directories( rqt_demo_plugin PUBLIC $ $ ) ament_target_dependencies( rqt_demo_plugin rclcpp pluginlib rqt_gui_cpp qt_gui_cpp geometry_msgs tf2 tf2_ros tf2_geometry_msgs Qt5Core Qt5Widgets Qt5Svg Qt5Qml Qt5Quick Qt5QuickControls2 mg_msgs ) install( TARGETS rqt_demo_plugin EXPORT export_${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ament_export_libraries( rqt_demo_plugin ) ament_export_targets( export_${PROJECT_NAME} ) target_compile_features(rqt_demo_plugin PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 ament_package()