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

Qt 5: don't create Designer module when cross-building + v2 linter changes #12477

Merged
merged 3 commits into from
Sep 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 52 additions & 48 deletions recipes/qt/5.x.x/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from conan import ConanFile
from conan.tools.build import cross_building
from conan.tools.microsoft import msvc_runtime_flag
from conan.errors import ConanInvalidConfiguration
from conan.tools.apple import is_apple_os
from conan.tools.build import build_jobs, check_min_cppstd, cross_building
from conan.tools.files import chdir, get, load, patch, replace_in_file, rm, rmdir, save
from conan.tools.microsoft import msvc_runtime_flag
from conan.tools.scm import Version
from conans import tools, RunEnvironment
from conans.model import Generator
import configparser
Expand All @@ -10,7 +13,7 @@
import os
import textwrap

required_conan_version = ">=1.43.0"
required_conan_version = ">=1.51.3"


class qt(Generator):
Expand Down Expand Up @@ -188,7 +191,7 @@ def build_requirements(self):
verstr = mybuf.getvalue().strip().split("Python ")[1]
if verstr.endswith("+"):
verstr = verstr[:-1]
version = tools.Version(verstr)
version = Version(verstr)
# >= 2.7.5 & < 3
v_min = "2.7.5"
v_max = "3.0.0"
Expand All @@ -212,12 +215,12 @@ def config_options(self):
del self.options.with_fontconfig
del self.options.with_libalsa
if self.settings.compiler == "apple-clang":
if tools.Version(self.settings.compiler.version) < "10.0":
if Version(self.settings.compiler.version) < "10.0":
raise ConanInvalidConfiguration("Old versions of apple sdk are not supported by Qt (QTBUG-76777)")
if self.settings.compiler in ["gcc", "clang"]:
if tools.Version(self.settings.compiler.version) < "5.0":
if Version(self.settings.compiler.version) < "5.0":
raise ConanInvalidConfiguration("qt 5.15.X does not support GCC or clang before 5.0")
if self.settings.compiler in ["gcc", "clang"] and tools.Version(self.settings.compiler.version) < "5.3":
if self.settings.compiler in ["gcc", "clang"] and Version(self.settings.compiler.version) < "5.3":
del self.options.with_mysql
if self.settings.os == "Windows":
self.options.with_mysql = False
Expand Down Expand Up @@ -294,7 +297,7 @@ def _enablemodule(mod):

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, "11")
check_min_cppstd(self, "11")
if self.options.widgets and not self.options.gui:
raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. "
"You can either disable qt:widgets or enable qt:gui")
Expand All @@ -309,7 +312,7 @@ def validate(self):
if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True):
raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported")

if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5":
if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5":
raise ConanInvalidConfiguration("Compiling Qt WebEngine with gcc < 5 is not supported")

if self.settings.os == "Android" and self.options.get_safe("opengl", "no") == "desktop":
Expand All @@ -329,10 +332,10 @@ def validate(self):
raise ConanInvalidConfiguration("Qt cannot be built as shared library with static runtime")

if self.settings.compiler == "apple-clang":
if tools.Version(self.settings.compiler.version) < "10.0":
if Version(self.settings.compiler.version) < "10.0":
raise ConanInvalidConfiguration("Old versions of apple sdk are not supported by Qt (QTBUG-76777)")
if self.settings.compiler in ["gcc", "clang"]:
if tools.Version(self.settings.compiler.version) < "5.0":
if Version(self.settings.compiler.version) < "5.0":
raise ConanInvalidConfiguration("qt 5.15.X does not support GCC or clang before 5.0")

if self.options.get_safe("with_pulseaudio", default=False) and not self.options["pulseaudio"].with_glib:
Expand All @@ -350,7 +353,7 @@ def requirements(self):
self.requires("pcre2/10.40")
if self.options.get_safe("with_vulkan"):
self.requires("vulkan-loader/1.3.221")
if tools.is_apple_os(self.settings.os):
if is_apple_os(self):
self.requires("moltenvk/1.1.10")
if self.options.with_glib:
self.requires("glib/2.73.2")
Expand Down Expand Up @@ -417,20 +420,20 @@ def requirements(self):
self.requires("md4c/0.4.8")

def source(self):
tools.get(**self.conan_data["sources"][self.version],
strip_root=True, destination="qt5")
get(self, **self.conan_data["sources"][self.version],
strip_root=True, destination="qt5")

for patch in self.conan_data.get("patches", {}).get(self.version, []):
tools.patch(**patch)
for data in self.conan_data.get("patches", {}).get(self.version, []):
patch(self, **data)
for f in ["renderer", os.path.join("renderer", "core"), os.path.join("renderer", "platform")]:
tools.replace_in_file(os.path.join(self.source_folder, "qt5", "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"),
" if (enable_precompiled_headers) {\n if (is_win) {",
" if (enable_precompiled_headers) {\n if (false) {"
)
tools.replace_in_file(os.path.join(self.source_folder, "qt5", "qtbase", "configure.json"),
"-ldbus-1d",
"-ldbus-1"
)
replace_in_file(self, os.path.join(self.source_folder, "qt5", "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"),
" if (enable_precompiled_headers) {\n if (is_win) {",
" if (enable_precompiled_headers) {\n if (false) {"
)
replace_in_file(self, os.path.join(self.source_folder, "qt5", "qtbase", "configure.json"),
"-ldbus-1d",
"-ldbus-1"
)

def _make_program(self):
if self._is_msvc:
Expand Down Expand Up @@ -749,21 +752,21 @@ def _getenvpath(var):
args.append(str(self.options.config))

os.mkdir("build_folder")
with tools.chdir("build_folder"):
with chdir(self, "build_folder"):
with tools.vcvars(self) if self._is_msvc else tools.no_op():
build_env = {"MAKEFLAGS": "j%d" % tools.cpu_count(), "PKG_CONFIG_PATH": [self.build_folder]}
build_env = {"MAKEFLAGS": "j%d" % build_jobs(self), "PKG_CONFIG_PATH": [self.build_folder]}
if self.settings.os == "Windows":
build_env["PATH"] = [os.path.join(self.source_folder, "qt5", "gnuwin32", "bin")]

with tools.environment_append(build_env):

if tools.os_info.is_macos:
tools.save(".qmake.stash" , "")
tools.save(".qmake.super" , "")
save(self, ".qmake.stash" , "")
save(self, ".qmake.super" , "")

self.run("%s/qt5/configure %s" % (self.source_folder, " ".join(args)), run_environment=True)
if tools.os_info.is_macos:
tools.save("bash_env", 'export DYLD_LIBRARY_PATH="%s"' % ":".join(RunEnvironment(self).vars["DYLD_LIBRARY_PATH"]))
save(self, "bash_env", 'export DYLD_LIBRARY_PATH="%s"' % ":".join(RunEnvironment(self).vars["DYLD_LIBRARY_PATH"]))
with tools.environment_append({
"BASH_ENV": os.path.abspath("bash_env")
}) if tools.os_info.is_macos else tools.no_op():
Expand All @@ -777,9 +780,9 @@ def _cmake_qt5_private_file(self, module):
return os.path.join("lib", "cmake", "Qt5{0}".format(module), "conan_qt_qt5_{0}private.cmake".format(module.lower()))

def package(self):
with tools.chdir("build_folder"):
with chdir(self, "build_folder"):
self.run("%s install" % self._make_program())
tools.save(os.path.join(self.package_folder, "bin", "qt.conf"), """[Paths]
save(self, os.path.join(self.package_folder, "bin", "qt.conf"), """[Paths]
Prefix = ..
ArchData = bin/archdatadir
HostData = bin/archdatadir
Expand All @@ -795,13 +798,13 @@ def package(self):
self.copy("*LICENSE*", src="qt5/", dst="licenses")
for module in self._submodules:
if not self.options.get_safe(module):
tools.rmdir(os.path.join(self.package_folder, "licenses", module))
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
rmdir(self, os.path.join(self.package_folder, "licenses", module))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
for mask in ["Find*.cmake", "*Config.cmake", "*-config.cmake"]:
tools.remove_files_by_mask(self.package_folder, mask)
tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la*")
tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb*")
tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb")
rm(self, mask, self.package_folder, recursive=True)
rm(self, "*.la*", os.path.join(self.package_folder, "lib"), recursive=True)
rm(self, "*.pdb*", os.path.join(self.package_folder, "lib"), recursive=True)
rm(self, "*.pdb", os.path.join(self.package_folder, "bin"), recursive=True)
# "Qt5Bootstrap" is internal Qt library - removing it to avoid linking error, since it contains
# symbols that are also in "Qt5Core.lib". It looks like there is no "Qt5Bootstrap.dll".
for fl in glob.glob(os.path.join(self.package_folder, "lib", "*Qt5Bootstrap*")):
Expand All @@ -810,12 +813,12 @@ def package(self):
for m in os.listdir(os.path.join(self.package_folder, "lib", "cmake")):
module = os.path.join(self.package_folder, "lib", "cmake", m, "%sMacros.cmake" % m)
if not os.path.isfile(module):
tools.rmdir(os.path.join(self.package_folder, "lib", "cmake", m))
rmdir(self, os.path.join(self.package_folder, "lib", "cmake", m))

extension = ""
if self.settings.os == "Windows":
extension = ".exe"
v = tools.Version(self.version)
v = Version(self.version)
filecontents = textwrap.dedent("""\
set(QT_CMAKE_EXPORT_NAMESPACE Qt5)
set(QT_VERSION_MAJOR {major})
Expand Down Expand Up @@ -869,7 +872,7 @@ def package(self):
endif()
""" % v.major)
filecontents += 'set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_GADGET_EXPORT" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")\n'
tools.save(os.path.join(self.package_folder, self._cmake_core_extras_file), filecontents)
save(self, os.path.join(self.package_folder, self._cmake_core_extras_file), filecontents)

def _create_private_module(module, dependencies=[]):
if "Core" not in dependencies:
Expand All @@ -890,7 +893,7 @@ def _create_private_module(module, dependencies=[]):
)
endif()""".format(module, self.version, dependencies_string))

tools.save(os.path.join(self.package_folder, self._cmake_qt5_private_file(module)), contents)
save(self, os.path.join(self.package_folder, self._cmake_qt5_private_file(module)), contents)

_create_private_module("Core")

Expand Down Expand Up @@ -928,7 +931,7 @@ def package_info(self):
if self.settings.build_type == "Debug":
if self.settings.os == "Windows":
libsuffix = "d"
elif tools.is_apple_os(self.settings.os):
elif is_apple_os(self):
libsuffix = "_debug"

def _get_corrected_reqs(requires):
Expand Down Expand Up @@ -1008,7 +1011,7 @@ def _create_plugin(pluginname, libname, plugintype, requires):
gui_reqs.append("opengl::opengl")
if self.options.get_safe("with_vulkan", False):
gui_reqs.append("vulkan-loader::vulkan-loader")
if tools.is_apple_os(self.settings.os):
if is_apple_os(self):
gui_reqs.append("moltenvk::moltenvk")
if self.options.with_harfbuzz:
gui_reqs.append("harfbuzz::harfbuzz")
Expand All @@ -1030,7 +1033,7 @@ def _create_plugin(pluginname, libname, plugintype, requires):
_create_module("FontDatabaseSupport", ["Core", "Gui"])
if self.settings.os == "Windows":
self.cpp_info.components["qtFontDatabaseSupport"].system_libs.extend(["advapi32", "ole32", "user32", "gdi32"])
elif tools.is_apple_os(self.settings.os):
elif is_apple_os(self):
self.cpp_info.components["qtFontDatabaseSupport"].frameworks.extend(["CoreFoundation", "CoreGraphics", "CoreText","Foundation"])
self.cpp_info.components["qtFontDatabaseSupport"].frameworks.append("AppKit" if self.settings.os == "Macos" else "UIKit")
if self.options.get_safe("with_fontconfig"):
Expand All @@ -1044,7 +1047,7 @@ def _create_plugin(pluginname, libname, plugintype, requires):
if self.options.get_safe("with_vulkan"):
_create_module("VulkanSupport", ["Core", "Gui"])

if tools.is_apple_os(self.settings.os):
if is_apple_os(self):
_create_module("ClipboardSupport", ["Core", "Gui"])
self.cpp_info.components["qtClipboardSupport"].frameworks = ["ImageIO"]
if self.settings.os == "Macos":
Expand Down Expand Up @@ -1164,7 +1167,8 @@ def _create_plugin(pluginname, libname, plugintype, requires):
self.cpp_info.components["qtUiPlugin"].libs = [] # this is a collection of abstract classes, so this is header-only
self.cpp_info.components["qtUiPlugin"].libdirs = []
_create_module("UiTools", ["UiPlugin", "Gui", "Widgets"])
_create_module("Designer", ["Gui", "UiPlugin", "Widgets", "Xml"])
if not cross_building(self):
_create_module("Designer", ["Gui", "UiPlugin", "Widgets", "Xml"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kambala-decapitator are you sure that the triggering factor is the cross compilation ? I looked at the .pro files in https://github.com/qt/qttools/tree/v5.15.5-lts-lgpl/src, but I could not find the link between cross compilation and the Designer module

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericLemanissier I made native and cross builds. In native all is good, the cross one complains with the error given in PR description.

Just made a clean test by making cross-build of Qt 5.15.5 and then trying to consume it in a test project.

conan install qt/5.15.5@ \
  --build=missing \
  --profile:build=default \
  --profile:host=macos-arm \
  -o "qt/*:config=-no-gif -no-ico -no-feature-imageformat_bmp -no-feature-imageformat_jpeg -no-feature-imageformat_ppm -no-feature-imageformat_xbm" \
  -o "qt/*:openssl=False" \
  -o "qt/*:qttools=True" \
  -o "qt/*:with_freetype=False" \
  -o "qt/*:with_libjpeg=False" \
  -o "qt/*:with_libpng=False"
  -o "qt/*:with_md4c=False" \
  -o "qt/*:with_mysql=False" \
  -o "qt/*:with_odbc=False" \
  -o "qt/*:with_openal=False" \
  -o "qt/*:with_pq=False"

(this step could've been omitted actually)

Test project:

from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout

class QtTestConan(ConanFile):
    name = "qt-test"
    version = "1.0"

    settings = "os", "compiler", "build_type", "arch"
    exports_sources = "CMakeLists.txt", "src/*"

    generators = "CMakeDeps", "CMakeToolchain"
    requires = [
        "qt/5.15.5",
    ]
    default_options = {
        "qt/*:config": "-no-gif -no-ico -no-feature-imageformat_bmp -no-feature-imageformat_jpeg -no-feature-imageformat_ppm -no-feature-imageformat_xbm",
        "qt/*:openssl": False,
        "qt/*:qttools": True,
        "qt/*:with_freetype": False,
        "qt/*:with_libjpeg": False,
        "qt/*:with_libpng": False,
        "qt/*:with_md4c": False,
        "qt/*:with_mysql": False,
        "qt/*:with_odbc": False,
        "qt/*:with_openal": False,
        "qt/*:with_pq": False,
    }

    def layout(self):
        cmake_layout(self)

    def build(self):
        cmake = CMake(self)
        cmake.configure()
        cmake.build()
cmake_minimum_required(VERSION 3.15)
project(qt-test CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

find_package(QT NAMES Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)

add_executable(qt-test src/main.cpp)
target_link_libraries(qt-test PUBLIC Qt${QT_VERSION_MAJOR}::Widgets)
#include <QApplication>
#include <QLabel>

int main(int argc, char* argv[]) {
	QApplication app{argc, argv};
	QLabel l{"hello world"};
	l.show();
	return app.exec();
}

Terminal commands used:

> mkdir build ; cd build

> conan install .. \
  --build=never \
  --profile:build=default \
  --profile:host=macos-arm
Configuration (profile_host):
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=13
os=Macos
os.version=11.0
[options]
[build_requires]
[env]

Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=13
os=Macos
os_build=Macos
[options]
[build_requires]
[env]

conanfile.py (qt-test/1.0): Installing package
Requirements
    bzip2/1.0.8 from 'conancenter' - Cache
    double-conversion/3.2.0 from 'conancenter' - Cache
    opengl/system from 'conancenter' - Cache
    pcre2/10.40 from 'conancenter' - Cache
    qt/5.15.5 from 'conancenter' - Cache
    sqlite3/3.39.2 from 'conancenter' - Cache
    zlib/1.2.12 from 'conancenter' - Cache
    zstd/1.5.2 from 'conancenter' - Cache
Packages
    bzip2/1.0.8:ae23570c81876eb0315a73e777a89b575afbadfc - Cache
    double-conversion/3.2.0:72de37736da93c527eaef675f8c4b4d47fc74be3 - Cache
    opengl/system:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    pcre2/10.40:53e84465d2ea14a22439afdf0afe768c2aae9efa - Cache
    qt/5.15.5:c59148b42e5e6abcc2dfdbbbe533d371da070b20 - Cache
    sqlite3/3.39.2:4edde61ab1eef56d31212aca5aded2f217305da8 - Cache
    zlib/1.2.12:d6df4e3f595d3dd83b3bd6e54fc150aae4f58e6d - Cache
    zstd/1.5.2:01b83ab98222ab7378364e52c9d6ad2ec462e4fc - Cache

Cross-build from 'Macos:x86_64' to 'Macos:armv8'
Installing (downloading, building) binaries...
bzip2/1.0.8: Already installed!
bzip2/1.0.8: Appending PATH environment variable: /Users/kambala/.conan/data/bzip2/1.0.8/_/_/package/ae23570c81876eb0315a73e777a89b575afbadfc/bin
double-conversion/3.2.0: Already installed!
opengl/system: Already installed!
sqlite3/3.39.2: Already installed!
sqlite3/3.39.2: Appending PATH env var with : /Users/kambala/.conan/data/sqlite3/3.39.2/_/_/package/4edde61ab1eef56d31212aca5aded2f217305da8/bin
zlib/1.2.12: Already installed!
zstd/1.5.2: Already installed!
pcre2/10.40: Already installed!
pcre2/10.40: Appending PATH environment variable: /Users/kambala/.conan/data/pcre2/10.40/_/_/package/53e84465d2ea14a22439afdf0afe768c2aae9efa/bin
qt/5.15.5: Already installed!
conanfile.py (qt-test/1.0): Generator 'CMakeDeps' calling 'generate()'
conanfile.py (qt-test/1.0): Generator txt created conanbuildinfo.txt
conanfile.py (qt-test/1.0): Generator 'CMakeToolchain' calling 'generate()'
conanfile.py (qt-test/1.0): Aggregating env generators
conanfile.py (qt-test/1.0): Generated conaninfo.txt
conanfile.py (qt-test/1.0): Generated graphinfo

> conan build ..
Using lockfile: '/Users/kambala/dev/conan/qt-test/build/conan.lock'
Using cached profile from lockfile
conanfile.py (qt-test/1.0): Calling build()
conanfile.py (qt-test/1.0): CMake command: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/Users/kambala/dev/conan/qt-test/build/generators/conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/Users/kambala/dev/conan/qt-test/."
-- Using Conan toolchain: /Users/kambala/dev/conan/qt-test/build/generators/conan_toolchain.cmake
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode13.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Component target declared 'Qt5::Core'
-- Conan: Component target declared 'Qt5::Gui'
-- Conan: Component target declared 'Qt5::EventDispatcherSupport'
-- Conan: Component target declared 'Qt5::FontDatabaseSupport'
-- Conan: Component target declared 'Qt5::ThemeSupport'
-- Conan: Component target declared 'Qt5::AccessibilitySupport'
-- Conan: Component target declared 'Qt5::ClipboardSupport'
-- Conan: Component target declared 'Qt5::GraphicsSupport'
-- Conan: Component target declared 'qt::QCocoaIntegrationPlugin'
-- Conan: Component target declared 'Qt5::QSQLiteDriverPlugin'
-- Conan: Component target declared 'Qt5::Network'
-- Conan: Component target declared 'Qt5::Sql'
-- Conan: Component target declared 'Qt5::Test'
-- Conan: Component target declared 'Qt5::Widgets'
-- Conan: Component target declared 'Qt5::PrintSupport'
-- Conan: Component target declared 'Qt5::OpenGL'
-- Conan: Component target declared 'Qt5::OpenGLExtensions'
-- Conan: Component target declared 'Qt5::Concurrent'
-- Conan: Component target declared 'Qt5::Xml'
-- Conan: Component target declared 'Qt5::LinguistTools'
-- Conan: Component target declared 'Qt5::UiPlugin'
-- Conan: Component target declared 'Qt5::UiTools'
-- Conan: Component target declared 'Qt5::Designer'
-- Conan: Component target declared 'Qt5::Help'
-- Conan: Component target declared 'Qt5::QCocoaIntegrationPlugin'
-- Conan: Component target declared 'Qt5::QMacStylePlugin'
-- Conan: Target declared 'qt::qt'
CMake Error at build/generators/cmakedeps_macros.cmake:39 (message):
  Library 'Qt5Designer' not found in package.  If 'Qt5Designer' is a system
  library, declare it with 'cpp_info.system_libs' property
Call Stack (most recent call first):
  build/generators/Qt5-Target-release.cmake:34 (conan_package_library_targets)
  build/generators/Qt5Targets.cmake:26 (include)
  build/generators/Qt5Config.cmake:10 (include)
  CMakeLists.txt:12 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/kambala/dev/conan/qt-test/build/Release/CMakeFiles/CMakeOutput.log".
See also "/Users/kambala/dev/conan/qt-test/build/Release/CMakeFiles/CMakeError.log".
ERROR: conanfile.py (qt-test/1.0): Error in build() method, line 35
	cmake.configure()
	ConanException: Error 1 while executing cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/Users/kambala/dev/conan/qt-test/build/generators/conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/Users/kambala/dev/conan/qt-test/."

As you can see, the error is exactly the same. If I apply my change, the error is gone.

just in case also tested shared Qt build, but the result is exactly the same.

Qt install log: qt-st.txt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, the fix is good. It is actually this line which disable qtdesigner lib build when cross compiling see also https://www.enricozini.org/blog/2020/qt5/cross-building-qt5-designer-component/

_create_module("Help", ["Gui", "Sql", "Widgets"])

if self.options.qtquick3d and self.options.gui:
Expand Down Expand Up @@ -1405,7 +1409,7 @@ def _create_plugin(pluginname, libname, plugintype, requires):
self.cpp_info.components[component_name].build_modules["cmake_find_package_multi"].append(module)
self.cpp_info.components[component_name].builddirs.append(os.path.join("lib", "cmake", m))

qt5core_config_extras_mkspec_dir_cmake = tools.load(
qt5core_config_extras_mkspec_dir_cmake = load(self,
os.path.join("lib", "cmake", "Qt5Core", "Qt5CoreConfigExtrasMkspecDir.cmake"))
mkspecs_dir_begin = qt5core_config_extras_mkspec_dir_cmake.find("mkspecs/")
mkspecs_dir_end = qt5core_config_extras_mkspec_dir_cmake.find("\"", mkspecs_dir_begin)
Expand Down Expand Up @@ -1441,7 +1445,7 @@ def _gather_libs(self, p):
if not p in self.deps_cpp_info.deps:
return []
libs = ["-l" + i for i in self.deps_cpp_info[p].libs + self.deps_cpp_info[p].system_libs]
if tools.is_apple_os(self.settings.os):
if is_apple_os(self):
libs += ["-framework " + i for i in self.deps_cpp_info[p].frameworks]
libs += self.deps_cpp_info[p].sharedlinkflags
for dep in self.deps_cpp_info[p].public_deps:
Expand Down