fixed qt related compilation errors

This commit is contained in:
matlabbe
2023-03-05 18:48:07 -08:00
parent edd86e4f56
commit 335fa60956
2 changed files with 13 additions and 3 deletions
+1 -3
View File
@@ -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} )
+12
View File
@@ -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})