Setup initial qt plugin demo
This commit is contained in:
72
CMakeLists.txt
Normal file
72
CMakeLists.txt
Normal file
@ -0,0 +1,72 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
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(Qt5 COMPONENTS Core REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Qml REQUIRED)
|
||||
find_package(Qt5 COMPONENTS Quick REQUIRED)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
qt_wrap_cpp(MOC_FILES include/rqt_demo_plugin/rqt_demo_plugin.hpp)
|
||||
qt5_add_resources(RCC_SOURCES "resources/res.qrc")
|
||||
|
||||
|
||||
add_library(
|
||||
rqt_demo_plugin
|
||||
SHARED
|
||||
src/rqt_demo_plugin.cpp
|
||||
${RCC_SOURCES}
|
||||
${MOC_FILES}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
rqt_demo_plugin
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
ament_target_dependencies(
|
||||
rqt_demo_plugin
|
||||
rclcpp
|
||||
pluginlib
|
||||
rqt_gui_cpp
|
||||
qt_gui_cpp
|
||||
Qt5Core
|
||||
Qt5Widgets
|
||||
Qt5Qml
|
||||
Qt5Quick
|
||||
)
|
||||
|
||||
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()
|
||||
Reference in New Issue
Block a user