conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
945 stars 1.71k forks source link

[qt] qt/5.15.14: `FindQt.cmake` not in package. #24837

Open PauloCarvalhoRJ opened 1 month ago

PauloCarvalhoRJ commented 1 month ago

Description

Hello,

I'm using Conan Center's Qt 5.x.x recipe (recipes/qt/5.x.x) to build Qt 5.15.14. The build seems to complete successfully, but I found that FindQt.cmake is not present in the final package directory. It is supposed to be at <conan cache dir>\b\qt<hash>\p\lib\cmake. By the way, no other Find*.cmake file is being installed.

I need this in order to build VTK with Qt support. VTK configuration with CMake (there is no Conan Center recipe for building it yet) needs these Find*.cmake files in order to work.

thanks,

Paulo

Package and Environment Details

Conan profile

[settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.version=194 os=Windows [conf] tools.cmake.cmake_layout:test_folder=C:\conan_tmp tools.cmake.cmaketoolchain:generator=Ninja

Steps to reproduce

conan create .

Logs

Not necessary (the build completes without issues).

jcar87 commented 1 month ago

Hi @PauloCarvalhoRJ -

these files are typically not packaged inside the package folders - they are generated on the consumer side with the CMakeDeps generator (alongside CMakeToolchain)

conan create .

If you are running this from a cloned copy of conan-center-index, please inspect contents of the generators folder inside the build folder - that's where Qt5Config.cmake should be found

PauloCarvalhoRJ commented 1 month ago

Hello,

they are generated on the consumer side

I understand this, but I beg to disagree. Qt (as any other library that supports CMake) was supposed to be deployed with those. Furthermore, this forces me to build VTK with Conan (which I am currently able to). However, if I want to build VTK outside Conan, I'll be unable to use Conan's Qt. For me, this is odd.

Also, suppose I'm developing an application that uses Qt. During development I'll have to be able to configure the project outside Conan (e.g. in Qt Creator). Without the Find*.cmake files, I expect trouble.

best,

PC

jcar87 commented 1 month ago

I think there is some confusion here.

As far as I'm aware, Qt does not come with the Find*.cmake files - a packaged Qt comes with -config.cmake files - which are a different mechanism to satisfy find_package() calls in CMake.

The recipes in Conan Center do not currently ship with -config.cmake files - but rather, the recipes need to express the same information the package_info() method such that they can be consumed with any build system, not just CMake.

The recipes in Conan Center are meant to be consumed with Conan - Conan will generate the config files with a call to conan install. Consuming the contents of the packages, you may have to do more work. You can probably edit the recipe and modify its behaviour to retain those files in the package contents - but then you'd have to handle the paths for every single dependency of Qt such that the find_package call is successful.

PauloCarvalhoRJ commented 1 month ago

Hi,

As far as I'm aware, Qt does not come with the Find*.cmake files

Along the precompiled one installed with the Windows installers avaiable on their website, you'll find FindQt5.cmake under <install_dir>\lib\cmake\Qt5Core.

best,

PC