semlanik / qtprotobuf

Protobuf generator and bindings for Qt framework
https://semlanik.github.io/qtprotobuf
MIT License
169 stars 38 forks source link

Cmake build examples : Trying to enable QML support for 'any', but Qt::Qml is not a target #268

Closed NikolaiBirolini closed 2 years ago

NikolaiBirolini commented 2 years ago

Hello everyone !! I don't know if it's a bug, but I have this issue :

Describe the bug When I build all the example with cmake, I have this error :

-- Generate Qt header for QGrpcStream -- Generate Qt header for QGrpcUserPasswordCredentials -- Add well-known type /usr/local/include/google/protobuf/any.proto CMake Error at cmake/QtProtobufGen.cmake:43 (message): Trying to enable QML support for 'any', but Qt::Qml is not a target.

find_package(Qt COMPONENTS Qml) is missing? Call Stack (most recent call first): src/wellknowntypes/CMakeLists.txt:27 (qtprotobuf_generate) src/wellknowntypes/CMakeLists.txt:47 (add_wellknowntype)

To Reproduce I'm following all the steps on the mainpage : cmake .. [-DCMAKE_PREFIX_PATH="<path/to/qt/installation>/Qt//gcc_64/lib/cmake"]

I entered : cmake .. -DCMAKE_PREFIX_PATH="/home/name/Qt-5-13/5.13.2/gcc_64/lib/cmake"

Environment:

I thank you in advance for your help !

semlanik commented 2 years ago

Hi @NikolaiBirolini could you please check if https://github.com/semlanik/qtprotobuf/pull/269/commits/fe78750160ff315cd09ad37572c4223cfc681938 fixes your issue. Thanks!

NikolaiBirolini commented 2 years ago

Thanks ! It worked !