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.4.2: qgen qt is built in debug mode cmake cannot find qt libraries #15425

Closed
sabelka opened this issue Jan 23, 2023 · 2 comments · Fixed by #15431
Closed

[package] qt/6.4.2: qgen qt is built in debug mode cmake cannot find qt libraries #15425

sabelka opened this issue Jan 23, 2023 · 2 comments · Fixed by #15431
Labels
bug Something isn't working

Comments

@sabelka
Copy link
Contributor

sabelka commented Jan 23, 2023

Description

I have a project where I use qt built with conan (on Windows using the MinGW toolchain).
Everything works fine if I compile in release mode, but when I switch to debug-mode, configuring my project with cmake using the conan-generated toolchain file fails. The reason is that the cmake files generated by conan use "d" suffixes for the names of Qt libraries, while the generated Qt package contains libraries without the "d" suffix.

I get the following errror message:

CMake Error at build-mingw-debug/cmakedeps_macros.cmake:39 (message):
  Library 'Qt6EntryPointd' not found in package.  If 'Qt6EntryPointd' is a
  system library, declare it with 'cpp_info.system_libs' property
Call Stack (most recent call first):
  build-mingw-debug/Qt6-Target-debug.cmake:24 (conan_package_library_targets)
  build-mingw-debug/Qt6Targets.cmake:26 (include)
  build-mingw-debug/Qt6Config.cmake:10 (include)
  CMakeLists.txt:73 (find_package)

In the Qt package there is only a libQt6EntryPoint.a but no libQt6EntryPointd.a

Package and Environment Details

  • Package Name/Version: qt/6.4.2
  • Operating System+version: Windows 11
  • Compiler+version: GCC 12 (mingw-builds/12.2.0)
  • Docker image: N/A
  • Conan version: conan 1.57.0
  • Python version: Python 3.11.0

Conan profile

[settings]
os=Windows
arch=x86_64
build_type=Release
compiler=gcc
compiler.threads=posix
compiler.libcxx=libstdc++11
compiler.version=12
compiler.exception=seh
[options]
[conf]
[build_requires]
*: mingw-builds/12.2.0
[env]

Steps to reproduce

My conanfile:

[requires]
qt/6.4.2
[options]
qt:with_mysql=False
qt:with_odbc=False
qt:with_brotli=False
[generators]
virtualenv
CMakeDeps
CMakeToolchain

My CMakeLists.txt:

cmake_minimum_required(VERSION 3.21)
project(testqt)
find_package(Qt6 COMPONENTS Core Widgets REQUIRED)

Commands:

mkdir build
cd build
conan install .. --build=missing -pr:h=mingw-debug -pr:b=mingw
activate.bat
cmake .. -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Debug

Logs

Click to expand log
Put your log output here
@sabelka sabelka added the bug Something isn't working label Jan 23, 2023
@ericLemanissier
Copy link
Contributor

Could you please try to change this line into if is_msvc(self): ?

@sabelka
Copy link
Contributor Author

sabelka commented Jan 23, 2023

Yes! This works!

ericLemanissier added a commit to ericLemanissier/conan-center-index that referenced this issue Jan 23, 2023
conan-center-bot pushed a commit that referenced this issue Jan 28, 2023
* [qt] fix: conanfile.py RuntimeError: OrderedDict mutated during iteration

* qt6: fix mingw debug lib names

fixes #15425
StellaSmith pushed a commit to StellaSmith/conan-center-index that referenced this issue Feb 2, 2023
* [qt] fix: conanfile.py RuntimeError: OrderedDict mutated during iteration

* qt6: fix mingw debug lib names

fixes conan-io#15425
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