mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-09-14 15:20:19 +08:00
fixed qt related compilation errors
This commit is contained in:
@@ -29,9 +29,7 @@ include_directories(
|
||||
|
||||
## We also use Ogre for rviz plugins
|
||||
# this file doesn't exist post-noetic, but pkg_check_modules still works
|
||||
IF(EXISTS $ENV{ROS_ROOT}/core/rosbuild/FindPkgConfig.cmake)
|
||||
include($ENV{ROS_ROOT}/core/rosbuild/FindPkgConfig.cmake)
|
||||
ENDIF()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(OGRE OGRE)
|
||||
include_directories( ${OGRE_INCLUDE_DIRS} )
|
||||
link_directories( ${OGRE_LIBRARY_DIRS} )
|
||||
|
||||
@@ -16,6 +16,15 @@ catkin_package(
|
||||
CATKIN_DEPENDS cv_bridge geometry_msgs std_msgs std_srvs nav_msgs rtabmap_msgs rtabmap_sync tf
|
||||
)
|
||||
|
||||
# catkin is not using cmake targets for dependencies,
|
||||
# so we should explcitly look for Qt to get compilation
|
||||
# flags (-fPIC missing)
|
||||
FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui QUIET)
|
||||
IF(NOT Qt5_FOUND)
|
||||
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui REQUIRED)
|
||||
INCLUDE(${QT_USE_FILE})
|
||||
ENDIF(NOT Qt5_FOUND)
|
||||
|
||||
###########
|
||||
## Build ##
|
||||
###########
|
||||
@@ -27,6 +36,9 @@ include_directories(
|
||||
)
|
||||
|
||||
add_executable(rtabmap_viz src/GuiNode.cpp src/GuiWrapper.cpp src/PreferencesDialogROS.cpp)
|
||||
IF(Qt5_FOUND)
|
||||
QT5_USE_MODULES(rtabmap_viz Widgets Core Gui)
|
||||
ENDIF(Qt5_FOUND)
|
||||
target_link_libraries(rtabmap_viz ${catkin_LIBRARIES})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user