Skip to content

Commit

Permalink
fix zint as requirement
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <[email protected]>
  • Loading branch information
uilianries committed Jun 12, 2024
1 parent 01628c1 commit 2793e6f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions recipes/limereport/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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'")

Check warning on line 79 in recipes/limereport/all/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Bad indentation. Found 16 spaces, expected 12

def source(self):
get(self, **self.conan_data["sources"][self.version],
Expand All @@ -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()
Expand Down

0 comments on commit 2793e6f

Please sign in to comment.