|
1 | | -cmake_minimum_required(VERSION 3.5) |
| 1 | +cmake_minimum_required(VERSION 3.20) |
2 | 2 | project(rviz_visual_tools) |
3 | 3 |
|
4 | | -# Default to C++14 |
| 4 | +# Default to C++17 |
5 | 5 | if(NOT CMAKE_CXX_STANDARD) |
6 | | - set(CMAKE_CXX_STANDARD 14) |
| 6 | + set(CMAKE_CXX_STANDARD 17) |
7 | 7 | endif() |
8 | 8 |
|
9 | 9 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
@@ -40,7 +40,15 @@ find_package(rviz_common REQUIRED) |
40 | 40 | find_package(rviz_rendering REQUIRED) |
41 | 41 | find_package(rviz_default_plugins REQUIRED) |
42 | 42 |
|
43 | | -find_package(Qt5 REQUIRED COMPONENTS Widgets) |
| 43 | + |
| 44 | +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Test Widgets Core5Compat) |
| 45 | +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test Widgets Core5Compat) |
| 46 | +if(${QT_VERSION} VERSION_LESS 5.15.0) |
| 47 | + function(qt_wrap_cpp out) |
| 48 | + qt5_wrap_cpp(_sources ${ARGN}) |
| 49 | + set("${out}" ${_sources} PARENT_SCOPE) |
| 50 | + endfunction() |
| 51 | +endif() |
44 | 52 |
|
45 | 53 | ## Qt5 boilerplate options from http://doc.qt.io/qt-5/cmake-manual.html |
46 | 54 | set(CMAKE_INCLUDE_CURRENT_DIR ON) |
@@ -84,7 +92,7 @@ ament_target_dependencies(${PROJECT_NAME}_gui PUBLIC |
84 | 92 | rviz_default_plugins |
85 | 93 | rviz_ogre_vendor |
86 | 94 | ) |
87 | | -target_link_libraries(${PROJECT_NAME}_gui PUBLIC Qt5::Widgets) |
| 95 | +target_link_libraries(${PROJECT_NAME}_gui PUBLIC Qt${QT_VERSION_MAJOR}::Widgets) |
88 | 96 |
|
89 | 97 | # prevent pluginlib from using boost |
90 | 98 | target_compile_definitions(${PROJECT_NAME}_gui PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") |
|
0 commit comments