diff --git a/CMakeLists.txt b/CMakeLists.txt index ac957230b7..959fc80502 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,13 +115,17 @@ set(GZ_FUEL_TOOLS_VER ${gz-fuel_tools10_VERSION_MAJOR}) # Find gz-gui gz_find_package(gz-gui9 REQUIRED) set(GZ_GUI_VER ${gz-gui9_VERSION_MAJOR}) -gz_find_package (Qt5 + +set(QT_MAJOR_VERSION 6) +set(QT_MINOR_VERSION 0) +gz_find_package (Qt${QT_MAJOR_VERSION} + VERSION ${QT_MAJOR_VERSION}.${QT_MINOR_VERSION} COMPONENTS Core Quick QuickControls2 REQUIRED - PKGCONFIG "Qt5Core Qt5Quick Qt5QuickControls2") + PKGCONFIG "Qt${QT_MAJOR_VERSION}Core Qt${QT_MAJOR_VERSION}Quick Qt${QT_MAJOR_VERSION}QuickControls2") #-------------------------------------- # Find gz-physics diff --git a/examples/plugin/gui_system_plugin/CMakeLists.txt b/examples/plugin/gui_system_plugin/CMakeLists.txt index 53ba9dc4ce..881eb6d1ef 100644 --- a/examples/plugin/gui_system_plugin/CMakeLists.txt +++ b/examples/plugin/gui_system_plugin/CMakeLists.txt @@ -10,7 +10,7 @@ set(CMAKE_AUTOMOC ON) find_package(gz-sim9 REQUIRED COMPONENTS gui) -QT5_ADD_RESOURCES(resources_RCC ${PROJECT_NAME}.qrc) +qt_add_resources(resources_RCC ${PROJECT_NAME}.qrc) add_library(${PROJECT_NAME} SHARED ${PROJECT_NAME}.cc diff --git a/examples/plugin/rendering_plugins/CMakeLists.txt b/examples/plugin/rendering_plugins/CMakeLists.txt index f8c8bd14b8..6d754fafba 100644 --- a/examples/plugin/rendering_plugins/CMakeLists.txt +++ b/examples/plugin/rendering_plugins/CMakeLists.txt @@ -16,7 +16,7 @@ set(CMAKE_AUTOMOC ON) find_package(gz-gui9 REQUIRED) -QT5_ADD_RESOURCES(resources_RCC ${GUI_PLUGIN}.qrc) +qt_add_resources(resources_RCC ${GUI_PLUGIN}.qrc) add_library(${GUI_PLUGIN} SHARED ${GUI_PLUGIN}.cc diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 472eba232d..7b853519a7 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -26,7 +26,7 @@ set(CMAKE_AUTORCC ON) # located in different directories than the containing .cc file. For Qt header # files in `include/gz/sim/gui`, we use qt5_wrap_cpp instead. There is # no need to add entries for Qt header files in `src/gui/`. -qt5_wrap_cpp(gui_sources +qt_wrap_cpp(gui_sources ${PROJECT_SOURCE_DIR}/include/gz/sim/gui/GuiSystem.hh ) @@ -51,8 +51,6 @@ target_link_libraries(${gui_target} gz-gui${GZ_GUI_VER}::gz-gui${GZ_GUI_VER} gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER} gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER} - ${Qt5Core_LIBRARIES} - ${Qt5Widgets_LIBRARIES} ) set(CMAKE_AUTOMOC OFF) diff --git a/src/gui/plugins/CMakeLists.txt b/src/gui/plugins/CMakeLists.txt index 93cf416713..e0e2fb5855 100644 --- a/src/gui/plugins/CMakeLists.txt +++ b/src/gui/plugins/CMakeLists.txt @@ -23,8 +23,8 @@ function(gz_add_gui_library library_name) cmake_parse_arguments(gz_add_gui_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - QT5_WRAP_CPP(${library_name}_headers_MOC ${gz_add_gui_library_QT_HEADERS}) - QT5_ADD_RESOURCES(${library_name}_RCC ${library_name}.qrc) + qt_wrap_cpp(${library_name}_headers_MOC ${gz_add_gui_library_QT_HEADERS}) + qt_add_resources(${library_name}_RCC ${library_name}.qrc) if(MSVC) # Warning #4251 is the "dll-interface" warning that tells you when types