Bug 2283325 - CMake target_link_libraries Qt6::QuickLayouts and Qt6::LabsQmlModels fails: "target includes non-existent path"
Summary: CMake target_link_libraries Qt6::QuickLayouts and Qt6::LabsQmlModels fails: "...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: qt6-qtdeclarative
Version: 40
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jan Grulich
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-05-26 17:25 UTC by nikolaus.einhauser
Modified: 2025-01-09 15:56 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-01-09 15:56:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description nikolaus.einhauser 2024-05-26 17:25:51 UTC
Trying to link either of these two components fails with the following error message (LabsQmlModels example):

CMake Error in CMakeLists.txt:
  Imported target "Qt6::LabsQmlModels" includes non-existent path

    "/usr/include/qt6/QtCore/6.7.0"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



This can be reproduced very easily using the following CMakeLists.txt:

cmake_minimum_required(VERSION 3.16)
project(layouts LANGUAGES CXX)

find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick QuickLayouts)

qt_standard_project_setup(REQUIRES 6.5)

qt_add_executable(example
    main.cpp
)

target_link_libraries(example PRIVATE
    Qt6::Core
    Qt6::Gui
    Qt6::Qml
    Qt6::Quick
    Qt6::QuickLayouts
)

This means that any software using either of these components can't currently be built (at least on my system). Let me know if you need further info to reproduce this. Thank you.


Reproducible: Always

Steps to Reproduce:
1. use example CMakeLists.txt and create dummy main.cpp
2. try to configure project by use of `cmake .`
Actual Results:  
CMakeError

Comment 1 Jan Grulich 2025-01-09 15:56:34 UTC
I believe this will be fixed with the workaround we did for CMake, where qt6-qtdeclarative-devel now automatically also installs qt6-qtbase-private-devel.


Note You need to log in before you can comment on or make changes to this bug.