Skip to content

Commit

Permalink
WIP: Use Qt6 if found
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschmeisser committed Jan 15, 2024
1 parent 344b106 commit 1f5efd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 1f5efd3

Please sign in to comment.