|
| 1 | +cmake_minimum_required(VERSION 3.8) |
| 2 | +project(autoware_minimap_overlay_rviz_plugin) |
| 3 | + |
| 4 | +if(NOT CMAKE_CXX_STANDARD) |
| 5 | + set(CMAKE_CXX_STANDARD 17) |
| 6 | +endif() |
| 7 | + |
| 8 | +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
| 9 | + add_compile_options(-Wall -Wextra -Wunused) |
| 10 | +endif() |
| 11 | + |
| 12 | +find_package(ament_cmake_auto REQUIRED) |
| 13 | +find_package(ament_cmake REQUIRED) |
| 14 | +find_package(rclcpp REQUIRED) |
| 15 | +find_package(rviz_common REQUIRED) |
| 16 | +find_package(rviz_default_plugins REQUIRED) |
| 17 | +find_package(sensor_msgs REQUIRED) |
| 18 | +find_package(tf2_ros REQUIRED) |
| 19 | +find_package(pluginlib REQUIRED) |
| 20 | +find_package(angles REQUIRED) |
| 21 | +find_package(Qt5 COMPONENTS Network REQUIRED) |
| 22 | +find_package(OGRE REQUIRED) |
| 23 | +ament_auto_find_build_dependencies() |
| 24 | + |
| 25 | +set( |
| 26 | + headers_to_moc |
| 27 | +) |
| 28 | + |
| 29 | +set( |
| 30 | + headers_to_not_moc |
| 31 | + src/include/minimap.hpp |
| 32 | + src/include/tile.hpp |
| 33 | + src/include/tile_field.hpp |
| 34 | + src/include/overlay_utils.hpp |
| 35 | +) |
| 36 | + |
| 37 | +foreach(header "${headers_to_moc}") |
| 38 | + qt5_wrap_cpp(display_moc_files "${header}") |
| 39 | +endforeach() |
| 40 | + |
| 41 | +set( |
| 42 | + display_source_files |
| 43 | + src/overlay_utils.cpp |
| 44 | + src/minimap.cpp |
| 45 | + src/tile.cpp |
| 46 | + src/tile_field.cpp |
| 47 | +) |
| 48 | + |
| 49 | +add_library( |
| 50 | + ${PROJECT_NAME} SHARED |
| 51 | + ${display_moc_files} |
| 52 | + ${headers_to_not_moc} |
| 53 | + ${display_source_files} |
| 54 | +) |
| 55 | + |
| 56 | +target_compile_options( |
| 57 | + ${PROJECT_NAME} |
| 58 | + PUBLIC |
| 59 | + "-DVEHICLEMAP_VERSION=\"${vehicle_map_VERSION}\"" |
| 60 | +) |
| 61 | + |
| 62 | +target_include_directories(${PROJECT_NAME} |
| 63 | + PRIVATE src |
| 64 | + PRIVATE /usr/include/x86_64-linux-gnu/qt5 |
| 65 | + PRIVATE ${OGRE_INCLUDE_DIRS} |
| 66 | + PRIVATE ${rviz_common_INCLUDE_DIRS} |
| 67 | + PRIVATE ${rviz_default_plugins_INCLUDE_DIRS} |
| 68 | +) |
| 69 | + |
| 70 | +target_link_libraries(${PROJECT_NAME} |
| 71 | + Qt5::Network |
| 72 | + Qt5::Widgets |
| 73 | + ${OGRE_LIBRARIES} |
| 74 | + ${rviz_common_LIBRARIES} |
| 75 | + ${rviz_default_plugins_LIBRARIES} |
| 76 | +) |
| 77 | + |
| 78 | +# prevent pluginlib from using boost |
| 79 | +target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") |
| 80 | +set_property(TARGET ${PROJECT_NAME} PROPERTY AUTOMOC ON) |
| 81 | + |
| 82 | +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/icons") |
| 83 | + install( |
| 84 | + DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/icons" |
| 85 | + DESTINATION "share/${PROJECT_NAME}" |
| 86 | + ) |
| 87 | +endif() |
| 88 | +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/resources") |
| 89 | + install( |
| 90 | + DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/resources" |
| 91 | + DESTINATION "share/${PROJECT_NAME}" |
| 92 | + ) |
| 93 | +endif() |
| 94 | + |
| 95 | +install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME} |
| 96 | + ARCHIVE DESTINATION lib |
| 97 | + LIBRARY DESTINATION lib |
| 98 | + RUNTIME DESTINATION bin |
| 99 | +) |
| 100 | + |
| 101 | +# Install demo |
| 102 | +install(FILES demo/demo.launch.xml |
| 103 | + DESTINATION share/${PROJECT_NAME}/launch) |
| 104 | +install(PROGRAMS demo/publish_demo_data |
| 105 | + DESTINATION lib/${PROJECT_NAME}) |
| 106 | + |
| 107 | +pluginlib_export_plugin_description_file(rviz_common plugin_description.xml) |
| 108 | +ament_package() |
0 commit comments