-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update conanfile to modern standards
[CURA-10475]
- Loading branch information
1 parent
c664e6c
commit d124a92
Showing
5 changed files
with
74 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,29 @@ | ||
from conan import ConanFile | ||
from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake | ||
from conan.tools.env import VirtualRunEnv | ||
from conans import tools | ||
from conan.tools.build import can_run | ||
from conan.tools.cmake import cmake_layout, CMake | ||
|
||
|
||
class ArcusTestConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" | ||
test_type = "explicit" | ||
|
||
def generate(self): | ||
cmake = CMakeDeps(self) | ||
cmake.generate() | ||
def build_requirements(self): | ||
self.test_requires("standardprojectsettings/[>=0.1.0]@ultimaker/stable") | ||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
self.requires("protobuf/3.21.4") | ||
|
||
venv = VirtualRunEnv(self) | ||
venv.generate() | ||
|
||
tc = CMakeToolchain(self, generator = "Ninja") | ||
if self.settings.compiler == "Visual Studio": | ||
tc.blocks["generic_system"].values["generator_platform"] = None | ||
tc.blocks["generic_system"].values["toolset"] = None | ||
tc.generate() | ||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def imports(self): | ||
if self.settings.os == "Windows" and not tools.cross_building(self, skip_x64_x86 = True): | ||
self.copy("*.dll", dst=".", src="@bindirs") | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
if can_run(self): | ||
ext = ".exe" if self.settings.os == "Windows" else "" | ||
prefix_path = "" if self.settings.os == "Windows" else "./" | ||
self.run(f"{prefix_path}test{ext}", env = "conanrun") |