Update documentation, clean up rviz plugin CMakeLists (#302)

- Among the lines added in #150, the one that fixes building with Qt5 is
  the following line:

  include_directories(${Qt5Widgets_INCLUDE_DIRS})

  The rest is redundant and actually doesn't do anything. A CMake
  variable named QtX_INCLUDE_DIRS is not defined when find_package()-ing
  Qt. Also, there is no need to find_package() Qt5 Widgets twice.

- In documentation, add sudo to rosdep init invocation, following
  http://wiki.ros.org/rosdep. Add a comment about the error which will
  be printed if the user has already run sudo rosdep init since
  installing ROS.
master
Juraj Oršulić 2017-04-20 12:30:20 +02:00 committed by Holger Rapp
parent 1babc6982a
commit f730bd5817
2 changed files with 3 additions and 4 deletions

View File

@ -48,15 +48,12 @@ target_link_libraries(${PROJECT_NAME} PUBLIC ${QT_LIBRARIES})
if(rviz_QT_VERSION VERSION_LESS "5") if(rviz_QT_VERSION VERSION_LESS "5")
message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}") message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
find_package(Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui) find_package(Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui)
include_directories(${Qt4_INCLUDE_DIRS})
include(${QT_USE_FILE}) include(${QT_USE_FILE})
else() else()
message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}") message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets) find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets)
find_package(Qt5Widgets REQUIRED)
set(QT_LIBRARIES Qt5::Widgets) set(QT_LIBRARIES Qt5::Widgets)
include_directories(${Qt5Widgets_INCLUDE_DIRS}) include_directories(${Qt5Widgets_INCLUDE_DIRS})
include_directories(${Qt5_INCLUDE_DIRS})
endif() endif()
add_definitions(-DQT_NO_KEYWORDS) add_definitions(-DQT_NO_KEYWORDS)

View File

@ -67,7 +67,9 @@ We recommend using `wstool <http://wiki.ros.org/wstool>`_ and `rosdep
wstool update -t src wstool update -t src
# Install deb dependencies. # Install deb dependencies.
rosdep init # The command 'sudo rosdep init' will print an error if you have already
# executed it since installing ROS. This error can be ignored.
sudo rosdep init
rosdep update rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y