Skip to content

Commit

Permalink
Remove default AUTOUIC=ON from all non-ui targets. Fixed yaml target …
Browse files Browse the repository at this point in the history
…not added correctly on Vcpkg. Fixed gui odom processing time.
  • Loading branch information
matlabbe committed Nov 20, 2023
1 parent aaff1ab commit a1d43d2
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 6 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,11 @@ IF(WITH_QT)
ENDIF()

IF(QT4_FOUND OR Qt5_FOUND OR Qt6_FOUND)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# For VCPKG build, set those global variables to off,
# we will enable them for jsut specific targets
set(CMAKE_AUTOMOC OFF)
set(CMAKE_AUTORCC OFF)
set(CMAKE_AUTOUIC OFF)
IF("${VTK_MAJOR_VERSION}" EQUAL 5)
FIND_PACKAGE(QVTK REQUIRED) # only for VTK 5
ELSE()
Expand Down
8 changes: 8 additions & 0 deletions examples/NoEventsExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ ADD_EXECUTABLE(noEventsExample main.cpp ${moc_srcs})

TARGET_LINK_LIBRARIES(noEventsExample rtabmap::gui)

SET_TARGET_PROPERTIES(
noEventsExample
PROPERTIES
AUTOUIC ON
AUTOMOC ON
AUTORCC ON
)

if(internal)
SET_TARGET_PROPERTIES( noEventsExample
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-noEventsExample)
Expand Down
8 changes: 8 additions & 0 deletions examples/RGBDMapping/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ ADD_EXECUTABLE(rgbd_mapping main.cpp ${moc_srcs})

TARGET_LINK_LIBRARIES(rgbd_mapping rtabmap::gui)

SET_TARGET_PROPERTIES(
rgbd_mapping
PROPERTIES
AUTOUIC ON
AUTOMOC ON
AUTORCC ON
)

if(internal)
SET_TARGET_PROPERTIES( rgbd_mapping
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-rgbd_mapping)
Expand Down
8 changes: 8 additions & 0 deletions examples/WifiMapping/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ ENDIF(APPLE)
ADD_EXECUTABLE(wifi_mapping ${srcs} ${moc_srcs})
TARGET_LINK_LIBRARIES(wifi_mapping rtabmap::gui ${LIBRARIES})

SET_TARGET_PROPERTIES(
wifi_mapping
PROPERTIES
AUTOUIC ON
AUTOMOC ON
AUTORCC ON
)

if(internal)
SET_TARGET_PROPERTIES( wifi_mapping
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-wifi_mapping)
Expand Down
3 changes: 3 additions & 0 deletions guilib/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ SET_TARGET_PROPERTIES(
VERSION ${RTABMAP_VERSION}
SOVERSION ${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}
EXPORT_NAME "gui"
AUTOUIC ON
AUTOMOC ON
AUTORCC ON
)

INSTALL(TARGETS rtabmap_gui EXPORT rtabmap_guiTargets
Expand Down
3 changes: 2 additions & 1 deletion guilib/src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,7 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataI
UDEBUG("");
_processingOdometry = true;
UTimer time;
UTimer timeTotal;
// Process Data

// Set color code as tooltip
Expand Down Expand Up @@ -1898,7 +1899,7 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataI
_ui->statsToolBox->updateStat("Odometry/Distance/m", _preferencesDialog->isTimeUsedInFigures()?data->stamp()-_firstStamp:(float)data->id(), odom.info().distanceTravelled, _preferencesDialog->isCacheSavedInFigures());
}

_ui->statsToolBox->updateStat("GUI/Refresh odom/ms", _preferencesDialog->isTimeUsedInFigures()?data->stamp()-_firstStamp:(float)data->id(), time.elapsed()*1000.0, _preferencesDialog->isCacheSavedInFigures());
_ui->statsToolBox->updateStat("GUI/Refresh odom/ms", _preferencesDialog->isTimeUsedInFigures()?data->stamp()-_firstStamp:(float)data->id(), timeTotal.elapsed()*1000.0, _preferencesDialog->isCacheSavedInFigures());
UDEBUG("Time updating Stats toolbox: %fs", time.ticks());
}
_processingOdometry = false;
Expand Down
7 changes: 5 additions & 2 deletions tools/EurocDataset/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
FIND_PACKAGE(yaml-cpp QUIET)

IF(yaml-cpp_FOUND)
# yaml-cpp 0.8.0 uses the wrong target in YAML_CPP_LIBRARIES.
IF(yaml-cpp_VERSION VERSION_EQUAL "0.8.0")
IF (TARGET yaml-cpp::yaml-cpp)
# yaml-cpp 0.8.0 uses target yaml-cpp::yaml-cpp.
SET(YAML_CPP_LIBRARIES yaml-cpp::yaml-cpp)
ELSEIF (TARGET yaml-cpp)
# yaml-cpp 0.7.0 uses target yaml-cpp (VCPKG).
SET(YAML_CPP_LIBRARIES yaml-cpp)
ENDIF()
ELSE()
find_package(PkgConfig QUIET)
Expand Down

0 comments on commit a1d43d2

Please sign in to comment.