Skip to content

[cmake] Qt6 cmake errors #6390

@jmackay2

Description

@jmackay2

Describe the bug

When building with Qt6 on Ubuntu 24.04 with ROS installed, cmake produces the following error:

 CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreVersionlessTargets.cmake:42 (message):
   Some (but not all) targets in this export set were already defined.

   Targets Defined: Qt::Core

   Targets not yet defined: Qt::CorePrivate

 Call Stack (most recent call first):
   /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreConfig.cmake:65 (include)
   /usr/share/cmake-3.28/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
   /usr/lib/x86_64-linux-gnu/cmake/Qt6/QtPublicDependencyHelpers.cmake:108 (find_dependency)
   /usr/lib/x86_64-linux-gnu/cmake/Qt6Concurrent/Qt6ConcurrentDependencies.cmake:39 (_qt_internal_find_qt_dependencies)
   /usr/lib/x86_64-linux-gnu/cmake/Qt6Concurrent/Qt6ConcurrentConfig.cmake:50 (include)
   /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake:167 (find_package)
   cmake/pcl_find_qt.cmake:28 (find_package)
   CMakeLists.txt:432 (include)

 Configuring incomplete, errors occurred!

Context

Building pcl with Qt6.

Expected behavior
CMake should be able to successfully find and link to Qt6 without the error.

Current Behavior

If you switch from WITH_QT=AUTO to WITH_QT=QT5 everything builds properly. Auto and QT6 produce the same error as seen above.

To Reproduce
Ubuntu 24.04 with ROS installed.
Install Qt6 from apt.
Try to run cmake for pcl with qt.

docker run -it --rm osrf/ros:rolling-desktop-full
git clone https://github.com/PointCloudLibrary/pcl.git
mkdir pcl/build
cd pcl/build
cmake ..

Your Environment (please complete the following information):

  • OS: Ubuntu 24.04
  • Compiler: CMake 3.28.3
  • PCL Version: HEAD

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions