Skip to content

Commit

Permalink
add virtual build env and tool requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-danielsson committed Apr 19, 2024
1 parent 28fa386 commit f821f4b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions recipes/qcustomplot/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import apply_conandata_patches, copy, get, export_conandata_patches, replace_in_file
from conan.tools.scm import Version
import os
Expand Down Expand Up @@ -47,6 +48,9 @@ def requirements(self):
if self.options.with_opengl and self.settings.os == "Windows":
self.requires("opengl/system")

def build_requirements(self):
self.tool_requires("qt/6.4.2")

def validate(self):
if self.settings.os == "Macos":
raise ConanInvalidConfiguration(f"{self.ref} Macos not supported at this moment")
Expand All @@ -66,6 +70,9 @@ def source(self):
destination=self.source_folder, strip_root=True)

def generate(self):
be = VirtualBuildEnv(self)
be.generate()

tc = CMakeToolchain(self)
tc.variables["QCUSTOMPLOT_SRC_DIR"] = self.source_folder.replace("\\", "/")
tc.variables["QCUSTOMPLOT_VERSION"] = self.version
Expand Down

0 comments on commit f821f4b

Please sign in to comment.