Skip to content

Commit

Permalink
Fixed plugin for qt5/jade following ros-visualization/rqt_common_plug…
Browse files Browse the repository at this point in the history
…ins#359 changes for rqt_image_view
  • Loading branch information
lucasw committed Feb 8, 2017
1 parent 1c550fc commit cda144d
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions rqt_pcl_visualizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ find_package(catkin REQUIRED COMPONENTS
)

## System dependencies are found with CMake's conventions
find_package(Qt4 COMPONENTS QtCore QtGUi REQUIRED)

include(${QT_USE_FILE})
if("${qt_gui_cpp_USE_QT_MAJOR_VERSION} " STREQUAL "5 ")
find_package(Qt5Widgets REQUIRED)
else()
find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED)
include(${QT_USE_FILE})
endif()

## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
Expand Down Expand Up @@ -124,8 +128,13 @@ set(rqt_pcl_visualizer_UIS
src/rqt_pcl_visualizer/my_plugin.ui
)

qt4_wrap_cpp(rqt_pcl_visualizer_MOCS ${rqt_pcl_visualizer_HDRS})
qt4_wrap_ui(rqt_pcl_visualizer_UIS_H ${rqt_pcl_visualizer_UIS})
if("${qt_gui_cpp_USE_QT_MAJOR_VERSION} " STREQUAL "5 ")
qt5_wrap_cpp(rqt_pcl_visualizer_MOCS ${rqt_pcl_visualizer_HDRS})
qt5_wrap_ui(rqt_pcl_visualizer_UIS_H ${rqt_pcl_visualizer_UIS})
else()
qt4_wrap_cpp(rqt_pcl_visualizer_MOCS ${rqt_pcl_visualizer_HDRS})
qt4_wrap_ui(rqt_pcl_visualizer_UIS_H ${rqt_pcl_visualizer_UIS})
endif()

###########
## Build ##
Expand Down Expand Up @@ -156,10 +165,14 @@ add_library(${PROJECT_NAME}
## Specify libraries to link a library or executable target against
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
)

if("${qt_gui_cpp_USE_QT_MAJOR_VERSION} " STREQUAL "5 ")
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
else()
target_link_libraries(${PROJECT_NAME} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
endif()

#############
## Install ##
#############
Expand Down

0 comments on commit cda144d

Please sign in to comment.