This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
forked from conan-io/conan-center-index
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(conan-io#18855) corrade: migrate to Conan v2
* corrade: migrate to Conan v2 * disable VS2022, simplify test_package * allow vs2022 * corrade: fix conandata.yml patch attributes * corrade: auto-load all exported CMake module files * corrade: get rid of vs_ide_version() * Fix linter error --------- Co-authored-by: memsharded <[email protected]> Co-authored-by: Rubén Rincón Blanco <[email protected]>
- Loading branch information
1 parent
6a44a2d
commit 2679cac
Showing
6 changed files
with
120 additions
and
112 deletions.
There are no files selected for viewing
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
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,28 +1,37 @@ | ||
from conans import ConanFile, CMake, tools | ||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake", "cmake_find_package" | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "CMakeDeps", "VirtualRunEnv" | ||
test_type = "explicit" | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def generate(self): | ||
tc = CMakeToolchain(self) | ||
tc.variables["WITH_UTILITY"] = self.dependencies["corrade"].options.with_utility | ||
if self.dependencies["corrade"].ref.version == "2019.10": | ||
tc.variables["VERSION_2019_10"] = True | ||
tc.generate() | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.definitions["WITH_UTILITY"] = self.options["corrade"].with_utility | ||
if self.deps_cpp_info["corrade"].version == "2019.10": | ||
cmake.definitions["VERSION_2019_10"] = True | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(bin_path, run_environment=True) | ||
|
||
if self.options["corrade"].with_utility: | ||
# Run corrade-rc | ||
self.run("corrade-rc --help", run_environment=True) | ||
if can_run(self): | ||
bin_path = os.path.join(self.cpp.build.bindir, "test_package") | ||
self.run(bin_path, env="conanrun") | ||
|
||
if self.settings.os == "Emscripten": | ||
bin_path = os.path.join("bin", "test_package.js") | ||
self.run("node {}".format(bin_path), run_environment=True) | ||
bin_path = os.path.join(self.cpp.build.bindir, "test_package.js") | ||
self.run(f"node {bin_path}", env="conanrun") |
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