-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#10456) [fmt] conan v2 compatibility
* fmt for 2.0 (#13) * add fmt for 2.0 * safe rm * remove names * add definition * fix * names back * remove export_sources * add exports_sources * - compat Signed-off-by: SSE4 <tomskside@gmail.com> * - really copy the license Signed-off-by: SSE4 <tomskside@gmail.com> * - fix header-only Signed-off-by: SSE4 <tomskside@gmail.com> * - define includedirs on component Signed-off-by: SSE4 <tomskside@gmail.com> * - run environment Signed-off-by: SSE4 <tomskside@gmail.com> * - restore v1 test_package Signed-off-by: SSE4 <tomskside@gmail.com> * - compat Signed-off-by: SSE4 <tomskside@gmail.com> * - port changes Signed-off-by: SSE4 <tomskside@gmail.com> * - simplify imports Signed-off-by: SSE4 <tomskside@gmail.com> * Update recipes/fmt/all/conanfile.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Update recipes/fmt/all/conanfile.py * - use conan.tools.files.rmdir() Signed-off-by: SSE4 <tomskside@gmail.com> * - change layout import Signed-off-by: SSE4 <tomskside@gmail.com> * - use can_run Signed-off-by: SSE4 <tomskside@gmail.com> * Update recipes/fmt/all/conanfile.py * Update recipes/fmt/all/test_v1_package/conanfile.py Co-authored-by: Javier G. Sogo <jgsogo@gmail.com> * - destination is not needed Signed-off-by: SSE4 <tomskside@gmail.com> * - remove useless try/catch Signed-off-by: SSE4 <tomskside@gmail.com> * Update recipes/fmt/all/conanfile.py Co-authored-by: Luis Martinez <lasote@gmail.com> * - try package_info @czoido suggested * Revert "- try package_info @czoido suggested" This reverts commit 56c874a. * - try one more package_info by @czoido * Update recipes/fmt/all/conanfile.py * - bump required version Signed-off-by: SSE4 <tomskside@gmail.com> * - fix hook Signed-off-by: SSE4 <tomskside@gmail.com> Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> Co-authored-by: Javier G. Sogo <jgsogo@gmail.com> Co-authored-by: Luis Martinez <lasote@gmail.com>
- Loading branch information
1 parent
342edb2
commit de720f0
Showing
10 changed files
with
105 additions
and
109 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
import os | ||
from conan import ConanFile | ||
from conan.tools.cmake import CMake, CMakeToolchain | ||
from conan.tools.build import can_run | ||
from conan.tools.cmake import cmake_layout | ||
|
||
from conans import ConanFile, CMake, tools | ||
|
||
required_conan_version = ">=1.43.0" | ||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "cmake", "cmake_find_package_multi" | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "CMakeDeps", "VirtualRunEnv" | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def generate(self): | ||
tc = CMakeToolchain(self) | ||
tc.variables["FMT_HEADER_ONLY"] = self.dependencies["fmt"].options.header_only | ||
tc.generate() | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.definitions["FMT_HEADER_ONLY"] = self.options["fmt"].header_only | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
self.run(os.path.join("bin", "test_package"), run_environment=True) | ||
self.run(os.path.join("bin", "test_ranges"), run_environment=True) | ||
if can_run(self): | ||
self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") | ||
self.run(os.path.join(self.cpp.build.bindirs[0], "test_ranges"), env="conanrun") |
3 changes: 3 additions & 0 deletions
3
...pes/fmt/all/test_cmakedeps/CMakeLists.txt → ...es/fmt/all/test_v1_package/CMakeLists.txt
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# pylint: skip-file | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "cmake", "cmake_find_package_multi" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.definitions["FMT_HEADER_ONLY"] = self.options["fmt"].header_only | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
self.run(os.path.join("bin", "test_package"), run_environment=True) | ||
self.run(os.path.join("bin", "test_ranges"), run_environment=True) |
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
File renamed without changes.