From 2793e6f057a22875a2dbc49edabaa9e0c7a5f161 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 12 Jun 2024 12:32:02 +0200 Subject: [PATCH] fix zint as requirement Signed-off-by: Uilian Ries --- recipes/limereport/all/conanfile.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/recipes/limereport/all/conanfile.py b/recipes/limereport/all/conanfile.py index af56154440a06..7025dc400f932 100644 --- a/recipes/limereport/all/conanfile.py +++ b/recipes/limereport/all/conanfile.py @@ -1,5 +1,5 @@ from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import copy, get +from conan.tools.files import copy, get, replace_in_file from conan.tools.build import check_min_cppstd from conan import ConanFile from conan.tools.microsoft import is_msvc @@ -60,10 +60,8 @@ def layout(self): def requirements(self): # QString included in Irglobal.h and Limereport expects be running Qt on customer side self.requires("qt/[>=5.15 <7]", transitive_headers=True, transitive_libs=True) - - def build_requirements(self): if self.options.with_zint: - self.tool_requires("zint/2.10.0") + self.requires("zint/2.10.0") def validate(self): if self.settings.compiler.cppstd: @@ -77,6 +75,8 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.ref} requires -o='qt/*:qtdeclarative=True'") if not (self.dependencies["qt"].options.qtsvg and self.dependencies["qt"].options.qttools): raise ConanInvalidConfiguration(f"{self.ref} requires -o='qt/*:qtsvg=True' and -o='qt/*:qttools=True'") + if self.options.with_zint and not self.dependencies["zint"].options.with_qt: + raise ConanInvalidConfiguration(f"{self.ref} option with_zint=True requires -o 'zint/*:with_qt=True'") def source(self): get(self, **self.conan_data["sources"][self.version], @@ -93,7 +93,12 @@ def generate(self): tc = CMakeDeps(self) tc.generate() + def _patch_sources(self): + # Avoid using vendozied zint + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(3rdparty)", "") + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build()