1
1
2
- if(OCTOVIS_QT5)
2
+ if(OCTOVIS_QT6)
3
+ find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGLWidgets Widgets Xml)
4
+ set(QT_LIBRARIES Qt6::Core Qt6::Gui Qt6::OpenGLWidgets Qt6::Widgets Qt6::Xml "${OPENGL_gl_LIBRARY}" "${OPENGL_glu_LIBRARY}")
5
+ else(OCTOVIS_QT6)
3
6
find_package(Qt5Core REQUIRED)
4
7
find_package(Qt5Gui REQUIRED)
5
8
find_package(Qt5OpenGL REQUIRED)
@@ -13,14 +16,7 @@ if(OCTOVIS_QT5)
13
16
"${Qt5Widgets_INCLUDE_DIRS}"
14
17
"${Qt5Xml_INCLUDE_DIRS}"
15
18
)
16
- else(OCTOVIS_QT5)
17
- # Qt4-support (more info: http://qtnode.net/wiki?title=Qt_with_cmake)
18
- find_package(Qt4 REQUIRED)
19
- set(QT_USE_QTOPENGL TRUE)
20
- set(QT_USE_QTXML TRUE)
21
- # include the files enabled above
22
- include(${QT_USE_FILE})
23
- endif(OCTOVIS_QT5)
19
+ endif(OCTOVIS_QT6)
24
20
25
21
# Mac OS X seems to require special linker flags:
26
22
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@@ -51,11 +47,11 @@ set(viewer_SRCS
51
47
)
52
48
53
49
# Resource files (icons, ...)
54
- if(OCTOVIS_QT5)
50
+ if(OCTOVIS_QT6)
51
+ QT6_ADD_RESOURCES(viewer_RES src/icons.qrc)
52
+ else(OCTOVIS_QT6)
55
53
QT5_ADD_RESOURCES(viewer_RES src/icons.qrc)
56
- else(OCTOVIS_QT5)
57
- QT4_ADD_RESOURCES(viewer_RES src/icons.qrc)
58
- endif(OCTOVIS_QT5)
54
+ endif(OCTOVIS_QT6)
59
55
60
56
#found QGLViewer lib dir
61
57
link_directories(${QGLViewer_LIBRARY_DIR})
@@ -74,11 +70,11 @@ SET(viewer_MOC_HDRS
74
70
)
75
71
76
72
# generate list of MOC srcs:
77
- if(OCTOVIS_QT5)
73
+ if(OCTOVIS_QT6)
74
+ QT6_WRAP_CPP(viewer_MOC_SRCS ${viewer_MOC_HDRS})
75
+ else(OCTOVIS_QT6)
78
76
QT5_WRAP_CPP(viewer_MOC_SRCS ${viewer_MOC_HDRS})
79
- else(OCTOVIS_QT5)
80
- QT4_WRAP_CPP(viewer_MOC_SRCS ${viewer_MOC_HDRS})
81
- endif(OCTOVIS_QT5)
77
+ endif(OCTOVIS_QT6)
82
78
83
79
# let cmake generate ui*.h files from .ui files (Qt Designer):
84
80
SET(viewer_UIS
@@ -87,11 +83,11 @@ SET(viewer_UIS
87
83
${PROJECT_SOURCE_DIR}/include/octovis/ViewerSettingsPanel.ui
88
84
${PROJECT_SOURCE_DIR}/include/octovis/ViewerSettingsPanelCamera.ui
89
85
)
90
- if(OCTOVIS_QT5)
86
+ if(OCTOVIS_QT6)
87
+ QT6_WRAP_UI(viewer_UIS_H ${viewer_UIS})
88
+ else(OCTOVIS_QT6)
91
89
QT5_WRAP_UI(viewer_UIS_H ${viewer_UIS})
92
- else(OCTOVIS_QT5)
93
- QT4_WRAP_UI(viewer_UIS_H ${viewer_UIS})
94
- endif(OCTOVIS_QT5)
90
+ endif(OCTOVIS_QT6)
95
91
96
92
# Don't forget to include output directory, otherwise
97
93
# the UI file won't be wrapped!
@@ -101,6 +97,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR})
101
97
# Library target
102
98
add_library(octovis-static STATIC ${viewerlib_SRCS})
103
99
target_link_libraries(octovis-static
100
+ ${QT_LIBRARIES}
104
101
${OPENGL_gl_LIBRARY}
105
102
${OPENGL_glu_LIBRARY}
106
103
${OCTOMAP_LIBRARIES}
@@ -110,6 +107,7 @@ set_target_properties(octovis-static PROPERTIES OUTPUT_NAME octovis)
110
107
111
108
add_library(octovis-shared SHARED ${viewerlib_SRCS})
112
109
target_link_libraries(octovis-shared
110
+ ${QT_LIBRARIES}
113
111
${OPENGL_gl_LIBRARY}
114
112
${OPENGL_glu_LIBRARY}
115
113
${OCTOMAP_LIBRARIES}
@@ -135,7 +133,6 @@ add_executable(octovis ${viewer_SRCS} ${viewer_UIS_H} ${viewer_MOC_SRCS} ${viewe
135
133
136
134
target_link_libraries(octovis
137
135
# ${QGLViewer_LIBRARIES}
138
- ${QT_LIBRARIES}
139
136
${OCTOMAP_LIBRARIES}
140
137
octovis-shared
141
138
)
0 commit comments