diff --git a/CMakeLists.txt b/CMakeLists.txt index d623dd4e7..56116da68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,9 +105,12 @@ find_package(OpenGL REQUIRED) set(CMAKE_AUTOMOC ON) -find_package(Qt5 REQUIRED COMPONENTS Core Widgets OpenGL) -set(QT_LIBRARIES Qt5::Widgets) -set(QTVERSION ${Qt5Widgets_VERSION}) +find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core) +# in theory: find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) +message(STATUS "Found Qt ${Qt${QT_VERSION_MAJOR}_VERSION}") +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets OpenGL) +set(QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Widgets) +set(QTVERSION ${Qt${QT_VERSION_MAJOR}Widgets_VERSION}) add_definitions(-DQT_NO_KEYWORDS) find_package(catkin REQUIRED diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bf6148858..b8f7d06c2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,4 +3,6 @@ add_subdirectory(image_view) if (CATKIN_ENABLE_TESTING) add_subdirectory(test) endif() -add_subdirectory(python_bindings) +if (QT_VERSION_MAJOR EQUAL 5) + add_subdirectory(python_bindings) +endif()