conan-io / conan-center-index

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

[package] qt/6.7.0: CMakeDeps does not include ProtobufTools macros #23375

Open myatsenko opened 7 months ago

myatsenko commented 7 months ago

Description

Doesn't compile the application if the qt_add_protobuf() function is used in CMakeLists.txt:

find_package(Qt6 REQUIRED COMPONENTS Core Network WebSockets Sql Protobuf Quick LinguistTools) ... qt_add_protobuf(myapp PROTO_FILES src/proto/example.proto)

Output: ... CMake Error at CMakeLists.txt:198 (qt_add_protobuf): Unknown CMake command "qt_add_protobuf".

conanfile.txt: [requires] qt/6.7.0 protobuf/[>3] [tool_requires] cmake/[>3.16] [generators] CMakeDeps CMakeToolchain [options] qt/6.7.0:shared=True qt/6.7.0:qtdeclarative=True qt/6.7.0:qtgrpc=True qt/6.7.0:qtmultimedia=True qt/6.7.0:qtshadertools=True qt/6.7.0:qttools=True qt/6.7.0:qtwebsockets=True qt/6.7.0:with_libjpeg=libjpeg qt/6.7.0:with_libpng=True qt/6.7.0:with_sqlite3=True

Package and Environment Details

Conan profile

[settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=17 compiler.libcxx=libstdc++11 compiler.version=9 os=Linux

Steps to reproduce

mkdir build conan install . --output-folder=build --build=missing cd build cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release

Logs

Click to expand log ``` -- Using Conan toolchain: /home/user/myapp/build/conan_toolchain.cmake -- Conan toolchain: C++ Standard 17 with extensions OFF -- The CXX compiler identification is GNU 9.4.0 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Conan: Component target declared 'Qt6::Core' -- Conan: Component target declared 'Qt6::Platform' -- Conan: Component target declared 'Qt6::Gui' -- Conan: Component target declared 'Qt6::XcbQpaPrivate' -- Conan: Component target declared 'Qt6::QXcbIntegrationPlugin' -- Conan: Component target declared 'Qt6::QGifPlugin' -- Conan: Component target declared 'Qt6::QIcoPlugin' -- Conan: Component target declared 'Qt6::QJpegPlugin' -- Conan: Component target declared 'Qt6::QSQLiteDriverPlugin' -- Conan: Component target declared 'Qt6::QPSQLDriverPlugin' -- Conan: Component target declared 'Qt6::QODBCDriverPlugin' -- Conan: Component target declared 'qt::QODBCDriverPlugin' -- Conan: Component target declared 'Qt6::Network' -- Conan: Component target declared 'Qt6::Sql' -- Conan: Component target declared 'Qt6::Test' -- Conan: Component target declared 'Qt6::Widgets' -- Conan: Component target declared 'Qt6::PrintSupport' -- Conan: Component target declared 'Qt6::OpenGL' -- Conan: Component target declared 'Qt6::OpenGLWidgets' -- Conan: Component target declared 'Qt6::Concurrent' -- Conan: Component target declared 'Qt6::Xml' -- Conan: Component target declared 'Qt6::Qml' -- Conan: Component target declared 'Qt6::QmlModels' -- Conan: Component target declared 'Qt6::QmlImportScanner' -- Conan: Component target declared 'Qt6::Quick' -- Conan: Component target declared 'Qt6::QuickWidgets' -- Conan: Component target declared 'Qt6::QuickShapes' -- Conan: Component target declared 'Qt6::QuickTest' -- Conan: Component target declared 'Qt6::QmlWorkerScript' -- Conan: Component target declared 'Qt6::LinguistTools' -- Conan: Component target declared 'Qt6::UiPlugin' -- Conan: Component target declared 'Qt6::UiTools' -- Conan: Component target declared 'Qt6::Designer' -- Conan: Component target declared 'Qt6::Help' -- Conan: Component target declared 'Qt6::ShaderTools' -- Conan: Component target declared 'Qt6::QuickControls2' -- Conan: Component target declared 'Qt6::QuickTemplates2' -- Conan: Component target declared 'Qt6::Multimedia' -- Conan: Component target declared 'Qt6::MultimediaWidgets' -- Conan: Component target declared 'Qt6::MultimediaQuick' -- Conan: Component target declared 'Qt6::WebSockets' -- Conan: Component target declared 'Qt6::Protobuf' -- Conan: Component target declared 'Qt6::Grpc' -- Conan: Target declared 'qt::qt' -- Conan: Target declared 'Fontconfig::Fontconfig' -- Conan: Target declared 'Freetype::Freetype' -- Conan: Target declared 'PNG::PNG' -- Conan: Target declared 'ZLIB::ZLIB' -- Conan: Including build module from '/home/user/.conan2/p/b/freeteaf9a0c243940/p/lib/cmake/conan-official-freetype-variables.cmake' -- Conan: Target declared 'harfbuzz::harfbuzz' -- Conan: Component target declared 'glib::glib-2.0' -- Conan: Component target declared 'glib::gmodule-no-export-2.0' -- Conan: Component target declared 'glib::gmodule-export-2.0' -- Conan: Component target declared 'glib::gmodule-2.0' -- Conan: Component target declared 'glib::gobject-2.0' -- Conan: Component target declared 'glib::gthread-2.0' -- Conan: Component target declared 'glib::gio-2.0' -- Conan: Component target declared 'glib::gresource' -- Conan: Component target declared 'glib::gio-unix-2.0' -- Conan: Target declared 'glib::glib' -- Conan: Component target declared 'libselinux::sepol' -- Conan: Component target declared 'libselinux::selinux' -- Conan: Target declared 'libselinux::libselinux' -- Conan: Component target declared 'PCRE2::8BIT' -- Conan: Component target declared 'PCRE2::POSIX' -- Conan: Component target declared 'PCRE2::16BIT' -- Conan: Component target declared 'PCRE2::32BIT' -- Conan: Target declared 'pcre2::pcre2' -- Conan: Component target declared 'odbc::_odbc' -- Conan: Component target declared 'odbc::odbcinst' -- Conan: Component target declared 'odbc::odbccr' -- Conan: Target declared 'ODBC::ODBC' -- Conan: Target declared 'libtool::libtool' -- Conan: Target declared 'automake::automake' -- Conan: Target declared 'autoconf::autoconf' -- Conan: Target declared 'm4::m4' -- Conan: Component target declared 'xkbcommon::libxkbcommon' -- Conan: Component target declared 'xkbcommon::libxkbcommon-x11' -- Conan: Component target declared 'xkbcommon::libxkbregistry' -- Conan: Component target declared 'xkbcommon::xkbcli-interactive-wayland' -- Conan: Target declared 'xkbcommon::xkbcommon' -- Conan: Target declared 'xkeyboard-config::xkeyboard-config' -- Conan: Component target declared 'wayland::wayland-scanner' -- Conan: Component target declared 'wayland::wayland-server' -- Conan: Component target declared 'wayland::wayland-client' -- Conan: Component target declared 'wayland::wayland-cursor' -- Conan: Component target declared 'wayland::wayland-egl' -- Conan: Component target declared 'wayland::wayland-egl-backend' -- Conan: Target declared 'wayland::wayland' -- Conan: Target declared 'LibXml2::LibXml2' -- Conan: Including build module from '/home/user/.conan2/p/b/libxmd918888bce302/p/lib/cmake/conan-official-libxml2-variables.cmake' -- Conan: Component target declared 'xorg::x11' -- Conan: Component target declared 'xorg::x11-xcb' -- Conan: Component target declared 'xorg::fontenc' -- Conan: Component target declared 'xorg::ice' -- Conan: Component target declared 'xorg::xau' -- Conan: Component target declared 'xorg::xaw7' -- Conan: Component target declared 'xorg::xcomposite' -- Conan: Component target declared 'xorg::xcursor' -- Conan: Component target declared 'xorg::xdamage' -- Conan: Component target declared 'xorg::xdmcp' -- Conan: Component target declared 'xorg::xext' -- Conan: Component target declared 'xorg::xfixes' -- Conan: Component target declared 'xorg::xi' -- Conan: Component target declared 'xorg::xinerama' -- Conan: Component target declared 'xorg::xkbfile' -- Conan: Component target declared 'xorg::xmu' -- Conan: Component target declared 'xorg::xmuu' -- Conan: Component target declared 'xorg::xpm' -- Conan: Component target declared 'xorg::xrandr' -- Conan: Component target declared 'xorg::xrender' -- Conan: Component target declared 'xorg::xres' -- Conan: Component target declared 'xorg::xscrnsaver' -- Conan: Component target declared 'xorg::xt' -- Conan: Component target declared 'xorg::xtst' -- Conan: Component target declared 'xorg::xv' -- Conan: Component target declared 'xorg::xxf86vm' -- Conan: Component target declared 'xorg::xcb-xkb' -- Conan: Component target declared 'xorg::xcb-icccm' -- Conan: Component target declared 'xorg::xcb-image' -- Conan: Component target declared 'xorg::xcb-keysyms' -- Conan: Component target declared 'xorg::xcb-randr' -- Conan: Component target declared 'xorg::xcb-render' -- Conan: Component target declared 'xorg::xcb-renderutil' -- Conan: Component target declared 'xorg::xcb-shape' -- Conan: Component target declared 'xorg::xcb-shm' -- Conan: Component target declared 'xorg::xcb-sync' -- Conan: Component target declared 'xorg::xcb-xfixes' -- Conan: Component target declared 'xorg::xcb-xinerama' -- Conan: Component target declared 'xorg::xcb' -- Conan: Component target declared 'xorg::xcb-atom' -- Conan: Component target declared 'xorg::xcb-aux' -- Conan: Component target declared 'xorg::xcb-event' -- Conan: Component target declared 'xorg::xcb-util' -- Conan: Component target declared 'xorg::xcb-dri3' -- Conan: Component target declared 'xorg::xcb-cursor' -- Conan: Component target declared 'xorg::xcb-dri2' -- Conan: Component target declared 'xorg::xcb-glx' -- Conan: Component target declared 'xorg::xcb-present' -- Conan: Component target declared 'xorg::xcb-composite' -- Conan: Component target declared 'xorg::xcb-ewmh' -- Conan: Component target declared 'xorg::xcb-res' -- Conan: Component target declared 'xorg::uuid' -- Conan: Component target declared 'xorg::sm' -- Conan: Target declared 'xorg::xorg' -- Conan: Target declared 'opengl::opengl' -- Conan: Component target declared 'OpenSSL::Crypto' -- Conan: Component target declared 'OpenSSL::SSL' -- Conan: Target declared 'openssl::openssl' -- Conan: Including build module from '/home/user/.conan2/p/b/opensa1eb47043024c/p/lib/cmake/conan-official-openssl-variables.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6Qml/conan_qt_qt6_policies.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6Core/conan_qt_executables_variables.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6Core/conan_qt_qt6_coreprivate.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6Core/Qt6CoreMacros.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6Core/Qt6CoreConfigExtras.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/Qt6ConfigExtras.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicToolHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicExternalProjectHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicPluginHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicWalkLibsHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicFindPackageHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicTargetHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicAppleHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicFinalizerHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicTestHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicCMakeHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicCMakeVersionHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6/QtPublicWasmToolchainHelpers.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6Gui/conan_qt_qt6_guiprivate.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6Widgets/conan_qt_qt6_widgetsprivate.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6Widgets/Qt6WidgetsMacros.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6Qml/conan_qt_qt6_qmlprivate.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6Qml/Qt6QmlConfigExtras.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6LinguistTools/Qt6LinguistToolsMacros.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/qtcd5895531aeed/p/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake' -- Conan: Including build module from '/home/user/.conan2/p/b/opensa1eb47043024c/p/lib/cmake/conan-official-openssl-variables.cmake' CMake Error at CMakeLists.txt:198 (qt_add_protobuf): Unknown CMake command "qt_add_protobuf". -- Configuring incomplete, errors occurred! See also "/home/user/myapp/build/CMakeFiles/CMakeOutput.log". ```
ericLemanissier commented 7 months ago

I just tried and got this configuration result:

Qt Protobuf:
  Qt Core types support .................. no
  Qt Gui types support ................... no
  Well-known types support ............... no
Qt Protobuf tools:
  Qt Protobuf generator .................. no
Qt GRPC:
  gRPC support ........................... yes
  QML gRPC support ....................... no
Qt GRPC tools:
  Qt GRPC generator ...................... no

so Probuf generator is actually not even compiled, cf https://github.com/qt/qtgrpc/blob/v6.7.0/src/protobuf/configure.cmake#L47-L52 Protobuf and protoc must be added to (build_)requirements of the recipe when options.qtgrpc is True, and added to the requirements of the proper component(s) in package_info. Don't hesitate to make a pull request doing this, I would review it.