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

use AUTOUIC, AUTOMOC and AUTORCC instead of QTX_WRAP_UI, QTX_WRAP_CPP, QTX_ADD_RESOURCES #1135

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ 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)
IF("${VTK_MAJOR_VERSION}" EQUAL 5)
FIND_PACKAGE(QVTK REQUIRED) # only for VTK 5
ELSE()
Expand Down
8 changes: 2 additions & 6 deletions examples/NoEventsExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ if(NOT internal)
FIND_PACKAGE(RTABMap REQUIRED COMPONENTS gui)
endif()

IF(QT4_FOUND)
QT4_WRAP_CPP(moc_srcs MapBuilder.h)
ELSEIF(Qt5_FOUND)
QT5_WRAP_CPP(moc_srcs MapBuilder.h)
ELSE()
QT6_WRAP_CPP(moc_srcs MapBuilder.h)
IF(QT4_FOUND OR Qt5_FOUND OR Qt6_FOUND)
SET(moc_srcs MapBuilder.h)
ENDIF()

ADD_EXECUTABLE(noEventsExample main.cpp ${moc_srcs})
Expand Down
8 changes: 2 additions & 6 deletions examples/RGBDMapping/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ if(NOT internal)
FIND_PACKAGE(RTABMap REQUIRED COMPONENTS gui)
endif()

IF(QT4_FOUND)
QT4_WRAP_CPP(moc_srcs MapBuilder.h)
ELSEIF(Qt5_FOUND)
QT5_WRAP_CPP(moc_srcs MapBuilder.h)
ELSE()
QT6_WRAP_CPP(moc_srcs MapBuilder.h)
IF(QT4_FOUND OR Qt5_FOUND OR Qt6_FOUND)
SET(moc_srcs MapBuilder.h)
ENDIF()

ADD_EXECUTABLE(rgbd_mapping main.cpp ${moc_srcs})
Expand Down
8 changes: 2 additions & 6 deletions examples/WifiMapping/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ if(NOT internal)
FIND_PACKAGE(RTABMap REQUIRED)
endif()

IF(QT4_FOUND)
QT4_WRAP_CPP(moc_srcs MapBuilder.h MapBuilderWifi.h)
ELSEIF(Qt5_FOUND)
QT5_WRAP_CPP(moc_srcs MapBuilder.h MapBuilderWifi.h)
ELSE()
QT6_WRAP_CPP(moc_srcs MapBuilder.h MapBuilderWifi.h)
IF(QT4_FOUND OR Qt5_FOUND OR Qt6_FOUND)
SET(moc_srcs MapBuilder.h MapBuilderWifi.h)
ENDIF()

SET(srcs
Expand Down
44 changes: 4 additions & 40 deletions guilib/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,46 +38,12 @@ SET(headers_ui
../include/${PROJECT_PREFIX}/gui/MultiSessionLocSubView.h
)

SET(uis
./ui/mainWindow.ui
./ui/preferencesDialog.ui
./ui/aboutDialog.ui
./ui/consoleWidget.ui
./ui/DatabaseViewer.ui
./ui/loopClosureViewer.ui
./ui/exportDialog.ui
./ui/postProcessingDialog.ui
./ui/exportCloudsDialog.ui
./ui/calibrationDialog.ui
./ui/createSimpleCalibrationDialog.ui
./ui/depthCalibrationDialog.ui
./ui/exportBundlerDialog.ui
./ui/editConstraintDialog.ui
./ui/multiSessionLocSubView.ui
)

SET(qrc
./GuiLib.qrc
)

IF(QT4_FOUND)
# generate rules for building source files from the resources
QT4_ADD_RESOURCES(srcs_qrc ${qrc})

#Generate .h files from the .ui files
QT4_WRAP_UI(moc_uis ${uis})

#This will generate moc_* for Qt
QT4_WRAP_CPP(moc_srcs ${headers_ui})
### Qt Gui stuff end###
ELSEIF(Qt5_FOUND)
QT5_ADD_RESOURCES(srcs_qrc ${qrc})
QT5_WRAP_UI(moc_uis ${uis})
QT5_WRAP_CPP(moc_srcs ${headers_ui})
ELSE()
QT6_ADD_RESOURCES(srcs_qrc ${qrc})
QT6_WRAP_UI(moc_uis ${uis})
QT6_WRAP_CPP(moc_srcs ${headers_ui})
IF(QT4_FOUND OR Qt5_FOUND OR Qt6_FOUND)
set(CMAKE_AUTOUIC_SEARCH_PATHS ./ui/)
ENDIF()


Expand Down Expand Up @@ -117,10 +83,8 @@ SET(SRC_FILES
./DepthCalibrationDialog.cpp
./3rdParty/QMultiComboBox.cpp
./opencv/vtkImageMatSource.cpp

${moc_srcs}
${moc_uis}
${srcs_qrc}
${qrc}
${headers_ui}
)

# to get includes in visual studio
Expand Down
Loading