Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] qt/6.6.0: lib/cmake/Qt6Qml/Qt6QmlConfig.cmake is missing #21231

Closed
ikoruk opened this issue Nov 19, 2023 · 7 comments · Fixed by #21263
Closed

[package] qt/6.6.0: lib/cmake/Qt6Qml/Qt6QmlConfig.cmake is missing #21231

ikoruk opened this issue Nov 19, 2023 · 7 comments · Fixed by #21263
Labels
bug Something isn't working

Comments

@ikoruk
Copy link

ikoruk commented Nov 19, 2023

Description

I can't figure out why but lib/cmake/Qt6Qml/Qt6QmlConfig.cmake is missing. This prevents qml plugins from being deployed and probably causes other issues.

Package and Environment Details

  • Package Name/Version: qt/6.6.0
  • Operating System+version: MacOS 14.1.1
  • Compiler+version: Clang 15
  • Conan version: conan 1.61.0
  • Python version: Python 3.11.6

Conan profile

[settings]
os=Macos
os_build=Macos
arch=armv8
arch_build=armv8
compiler=apple-clang
compiler.version=15
compiler.libcxx=libc++
build_type=Release
compiler.cppstd=20
os.version=13.0
[options]
[conf]
[build_requires]
[env]

Steps to reproduce

Install qt and check if lib/cmake/Qt6Qml/Qt6QmlConfig.cmake exists.
It exists in the homebrew installation.

Logs

@ikoruk ikoruk added the bug Something isn't working label Nov 19, 2023
@ericLemanissier
Copy link
Contributor

There are some answers in https://github.com/conan-io/conan-center-index/blob/master/docs/faqs.md#why-are-cmake-findconfig-files-and-pkg-config-files-not-packaged
Basically you have to use the CMakeDeps generator. Also, don't forget to enable option qt/*:qtdeclarative=True

@ikoruk
Copy link
Author

ikoruk commented Nov 20, 2023

I already do both. All the other cmake files are indeed packaged including Qt6QmlConfigExtras.cmake for example, it's just this one file that is missing. This prevents qt_generate_deploy_qml_app_script(...) from working saying qt_add_qml_module was not run when it was.

@ericLemanissier
Copy link
Contributor

ericLemanissier commented Nov 20, 2023

All the other cmake files are indeed packaged including Qt6QmlConfigExtras.cmake for example

no they are not "packaged", as explained in the link I posted in the last message. all the cmake config-files and find-modules are explicitely removed

Please give us at least the commands you are running, with the console output and the associated conanfile

EDIT: did you also enable qt/*:qtshadertools=True ?

@ikoruk
Copy link
Author

ikoruk commented Nov 20, 2023

All the rest of the cmake files are indeed in the package, whether you want to call that "packaged" or not. And yes I have enabled both qtdeclarative and qtshadertools. Here is the output of running an ls on the conan package:

ls ~/.conan/data/qt/6.6.0/_/_/package/ac05783a2e9af9031896768d0ba1c2f375fa0cb5/lib/cmake/Qt6Qml/Qt6QmlConfig*.cmake

~/.conan/data/qt/6.6.0/_/_/package/ac05783a2e9af9031896768d0ba1c2f375fa0cb5/lib/cmake/Qt6Qml/Qt6QmlConfigExtras.cmake
~/.conan/data/qt/6.6.0/_/_/package/ac05783a2e9af9031896768d0ba1c2f375fa0cb5/lib/cmake/Qt6Qml/Qt6QmlConfigVersion.cmake
~/.conan/data/qt/6.6.0/_/_/package/ac05783a2e9af9031896768d0ba1c2f375fa0cb5/lib/cmake/Qt6Qml/Qt6QmlConfigVersionImpl.cmake

And here on a homebrew installation of qt:

ls /opt/homebrew/opt/qt6/lib/cmake/Qt6Qml/Qt6QmlConfig*.cmake

/opt/homebrew/opt/qt6/lib/cmake/Qt6Qml/Qt6QmlConfig.cmake		/opt/homebrew/opt/qt6/lib/cmake/Qt6Qml/Qt6QmlConfigVersion.cmake
/opt/homebrew/opt/qt6/lib/cmake/Qt6Qml/Qt6QmlConfigExtras.cmake		/opt/homebrew/opt/qt6/lib/cmake/Qt6Qml/Qt6QmlConfigVersionImpl.cmake

Without this file, cmake returns the following error:

CMake Error at !/.conan/data/qt/6.6.0/_/_/package/ac05783a2e9af9031896768d0ba1c2f375fa0cb5/lib/cmake/Qt6Qml/Qt6QmlDeploySupport.cmake:51 (message):
  No QML imports information recorded for target Project.  The target must
  be an executable and qt_add_qml_module() must have been called with it.  If
  using a CMake version lower than 3.19, ensure that the executable is
  manually finalized with qt_finalize_target().  Missing file:

      .../build/Release/.qt/deploy_qml_imports/Project.cmake
Call Stack (most recent call first):
  .qt/deploy_qml_app_Project_a7259b822b.cmake:5 (qt_deploy_qml_imports)

This is even though the target is an executable and qt_add_qml_module was called.

To fix this I need to include explicitly [QT_PACKAGE_FOLDER]/lib/cmake/Qt6Qml/Qt6QmlConfigExtras.cmake but this should not be necessary and is very hacky. As far as I was able to track down it is called from Qt6QmlConfig.cmake which is missing.

I see that conan takes the approach to use its own cmake files but then it needs to explicity include the extra cmakes, specifically Qt6QmlMacros.cmake;Qt6QmlConfigExtras.cmake;Qt6QmlFindQmlscInternal.cmake

@ericLemanissier
Copy link
Contributor

Ok, thanks for the precision, things are clearer now.
I just added all the *Extras.cmake files as part of https://github.com/conan-io/conan-center-index/pull/21263/files
The inclusion of these modules seem to work because I get:

-- Conan: Including build module from '/home/eric/.conan2/p/b/qtc895efca52644/p/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake'
-- Conan: Including build module from '/home/eric/.conan2/p/b/qtc895efca52644/p/lib/cmake/Qt6Qml/Qt6QmlConfigExtras.cmake'

Unfortunately, I still get the same error as you do:

CMake Error at /home/eric/.conan2/p/b/qtc895efca52644/p/lib/cmake/Qt6Qml/Qt6QmlDeploySupport.cmake:51 (message):
  No QML imports information recorded for target myapp.  The target must be
  an executable and qt_add_qml_module() must have been called with it.  If
  using a CMake version lower than 3.19, ensure that the executable is
  manually finalized with qt_finalize_target().  Missing file:

      /home/eric/.conan2/p/b/tmp8281419767dda/b/.qt/deploy_qml_imports/myapp.cmake
Call Stack (most recent call first):
  deploy_MyApp.cmake:3 (qt_deploy_qml_imports)
  cmake_install.cmake:66 (include)



ERROR: tmp/1.2.3: Error in package() method, line 28
        cmake.install()
        ConanException: Error 1 while executing

I also tried to add include(/home/eric/.conan2/p/b/qtc895efca52644/p/lib/cmake/Qt6Qml/Qt6QmlConfigExtras.cmake) but it did not change the error. Maybe you have some idea ? Can you try this modified recipe ?

@ikoruk
Copy link
Author

ikoruk commented Nov 20, 2023

This seems to work for me! Weirdly qt didn't even need to recompile. Are you testing with qml sources? Could that be why it doesn't work for you?

@ericLemanissier
Copy link
Contributor

ericLemanissier commented Nov 20, 2023

woopsie, the failure I had was because I was building qt as static library. rebuilding now.

EDIT: yup, works for me too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants