Skip to content

[package] qt/6: QODBCDriverPlugin has two component #26737

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

Open
fnadeau opened this issue Mar 2, 2025 · 0 comments · May be fixed by #26738
Open

[package] qt/6: QODBCDriverPlugin has two component #26737

fnadeau opened this issue Mar 2, 2025 · 0 comments · May be fixed by #26738
Labels
bug Something isn't working

Comments

@fnadeau
Copy link
Contributor

fnadeau commented Mar 2, 2025

Description

QODBCDriverPlugin has two component:

-- Conan: Component target declared 'qt::QODBCDriverPlugin'
-- Conan: Component target declared 'Qt6::QODBCDriverPlugin'

which mean that in your code you'll have to do something like:

target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::QODBCDriverPlugin qt::QODBCDriverPlugin)

This can be observed in recipes/qt/6.x.x/test_package/build/gcc-14-x86_64-gnu20-release/generators/Qt6-release-x86_64-data.cmake when building the package.

For linux
qt::QODBCDriverPlugin expose lib ODBC::ODBC
For windows
qt::QODBCDriverPlugin expose lib odbc32

for both
Qt6::QODBCDriverPlugin expose lib Qt6::Core


Code in fault

        if self.options.with_odbc:
            _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", [])
            if self.settings.os != "Windows":
                self.cpp_info.components["QODBCDriverPlugin"].requires.append("odbc::odbc")
            else:
                self.cpp_info.components["QODBCDriverPlugin"].system_libs.append("odbc32")
        def _create_plugin(pluginname, libname, plugintype, requires):
            componentname = f"qt{pluginname}"
            ...
            self.cpp_info.components[componentname].libs = [libname + libsuffix]

When appending the required lib (either obdc::obdc or obdc32), components name is lack prefix qt used by _create_plugin

All other instances of libs append uses the prefix qt, ex:

self.cpp_info.components["qtPrintSupport"].system_libs.append("winspool")

Easiest fix would be to just at the prefix qt to QODBCDriverPlugin when adding requirements outside of _create_plugin().

Package and Environment Details

  • Package Name/Version: qt/6
  • Operating System+version: Linux ArchLinux
  • Compiler+version: GCC 14
  • Conan version: conan 2.13.0
  • Python version: Python 3.13.2

Conan profile

Host profile:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu20
compiler.libcxx=libstdc++11
compiler.version=14
os=Linux
[conf]

Build profile:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu20
compiler.libcxx=libstdc++11
compiler.version=14
os=Linux
[conf]

Steps to reproduce

conan create --version 6.7.3 recipes/qt/6.x.x -c:a qt/6*:tools.cmake.cmaketoolchain:extra_variables="{'CMAKE_DISABLE_FIND_PACKAGE_Libb2':'ON'}

note I'm using CMAKE_DISABLE_FIND_PACKAGE_Libb2 because I have the lib on my system, see #26551

Logs

Partial log, just before the test package is build. Alternatively, anytime Qt is used by conan by any other project.

Click to expand log
-- Using Conan toolchain: /home/fnadeau/src/conan-center-index/recipes/qt/6.x.x/test_package/build/gcc-14-x86_64-gnu20-release/generators/conan_toolchain.cmake
-- Conan toolchain: Defining architecture flag: -m64
-- Conan toolchain: C++ Standard 20 with extensions ON
-- The CXX compiler identification is GNU 14.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- 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 'qt::QODBCDriverPlugin'
-- Conan: Component target declared 'Qt6::Gui'
-- Conan: Component target declared 'Qt6::XcbQpaPrivate'
-- Conan: Component target declared 'Qt6::QSQLiteDriverPlugin'
-- Conan: Component target declared 'Qt6::QPSQLDriverPlugin'
-- Conan: Component target declared 'Qt6::QODBCDriverPlugin'
-- Conan: Component target declared 'Qt6::Network'
-- Conan: Component target declared 'Qt6::Sql'
-- Conan: Component target declared 'Qt6::Test'
-- Conan: Component target declared 'Qt6::Concurrent'
-- Conan: Component target declared 'Qt6::Xml'
-- Conan: Component target declared 'Qt6::QXcbIntegrationPlugin'
-- Conan: Component target declared 'Qt6::QGifPlugin'
-- Conan: Component target declared 'Qt6::QIcoPlugin'
-- Conan: Component target declared 'Qt6::Widgets'
-- Conan: Component target declared 'Qt6::OpenGL'
-- Conan: Component target declared 'Qt6::PrintSupport'
-- Conan: Component target declared 'Qt6::OpenGLWidgets'
-- Conan: Target declared 'qt::qt'
-- Conan: Component target declared 'OpenSSL::Crypto'
-- Conan: Component target declared 'OpenSSL::SSL'
-- Conan: Target declared 'openssl::openssl'
@fnadeau fnadeau added the bug Something isn't working label Mar 2, 2025
@fnadeau fnadeau linked a pull request Mar 2, 2025 that will close this issue
3 tasks
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.

1 participant