Fixed build for Lunar

This commit is contained in:
matlabbe
2017-08-03 16:40:12 -04:00
parent c0c288e0d9
commit 2a9508b4e3
5 changed files with 25 additions and 6 deletions
+5 -3
View File
@@ -171,9 +171,11 @@ FIND_PACKAGE(OpenCV REQUIRED QUIET)
FIND_PACKAGE(PCL 1.7 REQUIRED QUIET) FIND_PACKAGE(PCL 1.7 REQUIRED QUIET)
FIND_PACKAGE(ZLIB REQUIRED QUIET) FIND_PACKAGE(ZLIB REQUIRED QUIET)
# fix libproj.so not found on Xenial
if(NOT "${PCL_LIBRARIES}" STREQUAL "") if(NOT "${PCL_LIBRARIES}" STREQUAL "")
# fix libproj.so not found on Xenial
list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4") list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")
# fix libmpi.so not found on Zesty
list(REMOVE_ITEM PCL_LIBRARIES "/usr/lib/libmpi.so")
endif() endif()
# OpenMP ("-fopenmp" should be added for flann included in PCL) # OpenMP ("-fopenmp" should be added for flann included in PCL)
@@ -214,12 +216,12 @@ IF(WITH_QT)
IF("${VTK_MAJOR_VERSION}" GREATER 5) IF("${VTK_MAJOR_VERSION}" GREATER 5)
FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui QUIET) FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui QUIET)
IF(Qt5_FOUND) IF(Qt5_FOUND)
FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui Svg) FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui OPTIONAL_COMPONENTS Svg)
ENDIF(Qt5_FOUND) ENDIF(Qt5_FOUND)
ENDIF("${VTK_MAJOR_VERSION}" GREATER 5) ENDIF("${VTK_MAJOR_VERSION}" GREATER 5)
IF(NOT Qt5_FOUND) IF(NOT Qt5_FOUND)
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtSvg) FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui OPTIONAL_COMPONENTS QtSvg)
ENDIF(NOT Qt5_FOUND) ENDIF(NOT Qt5_FOUND)
IF(QT4_FOUND OR Qt5_FOUND) IF(QT4_FOUND OR Qt5_FOUND)
+5 -1
View File
@@ -74,7 +74,11 @@ ELSE()
ENDIF() ENDIF()
TARGET_LINK_LIBRARIES(rtabmap rtabmap_core rtabmap_gui rtabmap_utilite ${LIBRARIES}) TARGET_LINK_LIBRARIES(rtabmap rtabmap_core rtabmap_gui rtabmap_utilite ${LIBRARIES})
IF(Qt5_FOUND) IF(Qt5_FOUND)
QT5_USE_MODULES(rtabmap Widgets Core Gui Svg PrintSupport) IF(Qt5Svg_FOUND)
QT5_USE_MODULES(rtabmap Widgets Core Gui Svg PrintSupport)
ELSE()
QT5_USE_MODULES(rtabmap Widgets Core Gui PrintSupport)
ENDIF()
ENDIF(Qt5_FOUND) ENDIF(Qt5_FOUND)
IF(APPLE AND BUILD_AS_BUNDLE) IF(APPLE AND BUILD_AS_BUNDLE)
+1 -1
View File
@@ -811,7 +811,7 @@ void Parameters::readINI(const std::string & configFile, ParametersMap & paramet
{ {
ULOGGER_WARN("Section \"Core\" in %s doesn't exist... " ULOGGER_WARN("Section \"Core\" in %s doesn't exist... "
"Ignore this warning if the ini file does not exist yet. " "Ignore this warning if the ini file does not exist yet. "
"The ini file will be automatically created when this node will close.", configFile.c_str()); "The ini file will be automatically created when rtabmap will close.", configFile.c_str());
} }
} }
+5 -1
View File
@@ -161,7 +161,11 @@ ADD_LIBRARY(rtabmap_gui ${SRC_FILES})
TARGET_LINK_LIBRARIES(rtabmap_gui rtabmap_core rtabmap_utilite ${LIBRARIES}) TARGET_LINK_LIBRARIES(rtabmap_gui rtabmap_core rtabmap_utilite ${LIBRARIES})
IF(Qt5_FOUND) IF(Qt5_FOUND)
QT5_USE_MODULES(rtabmap_gui Widgets Core Gui Svg PrintSupport) IF(Qt5Svg_FOUND)
QT5_USE_MODULES(rtabmap_gui Widgets Core Gui Svg PrintSupport)
ELSE()
QT5_USE_MODULES(rtabmap_gui Widgets Core Gui PrintSupport)
ENDIF()
ENDIF(Qt5_FOUND) ENDIF(Qt5_FOUND)
SET_TARGET_PROPERTIES( SET_TARGET_PROPERTIES(
+9
View File
@@ -37,7 +37,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QtGui/QDesktopServices> #include <QtGui/QDesktopServices>
#include <QtGui/QContextMenuEvent> #include <QtGui/QContextMenuEvent>
#include <QColorDialog> #include <QColorDialog>
#ifdef QT_SVG_LIB
#include <QtSvg/QSvgGenerator> #include <QtSvg/QSvgGenerator>
#endif
#include <QInputDialog> #include <QInputDialog>
#include <QMessageBox> #include <QMessageBox>
@@ -1233,6 +1235,9 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
QMenu menu; QMenu menu;
QAction * aScreenShotPNG = menu.addAction(tr("Take a screenshot (PNG)")); QAction * aScreenShotPNG = menu.addAction(tr("Take a screenshot (PNG)"));
QAction * aScreenShotSVG = menu.addAction(tr("Take a screenshot (SVG)")); QAction * aScreenShotSVG = menu.addAction(tr("Take a screenshot (SVG)"));
#ifndef QT_SVG_LIB
aScreenShotSVG->setEnabled(false);
#endif
menu.addSeparator(); menu.addSeparator();
QAction * aChangeNodeColor = menu.addAction(createIcon(_nodeColor), tr("Set node color...")); QAction * aChangeNodeColor = menu.addAction(createIcon(_nodeColor), tr("Set node color..."));
@@ -1422,6 +1427,7 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
} }
else else
{ {
#ifdef QT_SVG_LIB
QSvgGenerator svgGen; QSvgGenerator svgGen;
svgGen.setFileName( targetDir + name ); svgGen.setFileName( targetDir + name );
@@ -1433,6 +1439,9 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
QPainter painter( &svgGen ); QPainter painter( &svgGen );
this->scene()->render(&painter); this->scene()->render(&painter);
#else
UERROR("RTAB-MAp is not built with Qt's SVG library, cannot save picture in svg format.");
#endif
} }
//reset scale //reset scale