Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatible with Qt5 #238

Open
wants to merge 11 commits into
base: ros2
Choose a base branch
from
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) # enables -fPIC in applicable compilers

option(BUILD_OCTOVIS_SUBPROJECT "Build targets from subproject octovis" ON)
option(BUILD_DYNAMICETD3D_SUBPROJECT "Build targets from subproject dynamicEDT3D" ON)
option(OCTOVIS_QT5 "Link Octovis against Qt5?" NO)
option(OCTOVIS_QT5 "Link Octovis against Qt5?" ON)

if(OCTOVIS_QT5)
# Compiling against QT5 requires C++11.
Expand Down
7 changes: 5 additions & 2 deletions octovis/CMakeModules/FindQGLViewer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ FIND_PATH( QGLViewer_INCLUDE_DIR qglviewer.h
/opt/local/include/QGLViewer
${QGLVIEWER_BASE_DIR}
)

if(QT4_FOUND)
FIND_LIBRARY( QGLViewer_LIBRARY_DIR_UBUNTU NAMES qglviewer-qt4 QGLViewer-qt4)
else()
FIND_LIBRARY( QGLViewer_LIBRARY_DIR_UBUNTU NAMES qglviewer-qt5 QGLViewer-qt5)
endif()
FIND_LIBRARY( QGLViewer_LIBRARY_DIR_WINDOWS QGLViewer2 ${QGLVIEWER_BASE_DIR})
FIND_LIBRARY( QGLViewer_LIBRARY_DIR_OTHER QGLViewer ${QGLVIEWER_BASE_DIR})

Expand Down Expand Up @@ -119,4 +122,4 @@ ENDIF()
# You need to use qmake of QT4. You are using QT3 if you get:

#CMakeFiles/octovis.dir/ViewerWidget.cpp.o: In function `octomap::ViewerWidget::ViewerWidget(QWidget*)':
#ViewerWidget.cpp:(.text+0x1715): undefined reference to `QGLViewer::QGLViewer(QWidget*, QGLWidget const*, QFlags<Qt::WindowType>)'
#ViewerWidget.cpp:(.text+0x1715): undefined reference to `QGLViewer::QGLViewer(QWidget*, QGLWidget const*, QFlags<Qt::WindowType>)'
3 changes: 3 additions & 0 deletions octovis/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<depend>libqt4-dev</depend>
<depend>libqt4-opengl-dev</depend>

<depend>qtbase5-dev</depend>
<depend>libqt5-core</depend>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add libqt5-core

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I need to replace it or add it as a new depend?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think add as another, but I haven't tested or looked into it deeply - just checked the correct rosdep key.

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down