diff --git a/recipes/string-view-lite/all/conandata.yml b/recipes/string-view-lite/all/conandata.yml index 497675b668978..a488451172721 100644 --- a/recipes/string-view-lite/all/conandata.yml +++ b/recipes/string-view-lite/all/conandata.yml @@ -1,13 +1,13 @@ sources: - "1.3.0": - url: https://github.com/martinmoene/string-view-lite/archive/v1.3.0.tar.gz - sha256: d83adb0495ccfba50ae5a1af70bde04f33a26dc40599b0ce9e55f09c075daf23 - "1.4.0": - url: https://github.com/martinmoene/string-view-lite/archive/v1.4.0.tar.gz - sha256: 650c135be0bdc5bcae6876864b8279f15b1b97069da944ec2c773cacdea27e27 - "1.5.1": - url: https://github.com/martinmoene/string-view-lite/archive/v1.5.1.tar.gz - sha256: 1212d30b404a2c0a6f7192465102501955dcf3740ee100474e8fc2ac8e783c2f "1.6.0": - url: https://github.com/martinmoene/string-view-lite/archive/v1.6.0.tar.gz - sha256: 852d6dfec810067258a8cfc478d81fe7c08d473701e1989ec59769f549e50bae + url: "https://github.com/martinmoene/string-view-lite/archive/v1.6.0.tar.gz" + sha256: "852d6dfec810067258a8cfc478d81fe7c08d473701e1989ec59769f549e50bae" + "1.5.1": + url: "https://github.com/martinmoene/string-view-lite/archive/v1.5.1.tar.gz" + sha256: "1212d30b404a2c0a6f7192465102501955dcf3740ee100474e8fc2ac8e783c2f" + "1.4.0": + url: "https://github.com/martinmoene/string-view-lite/archive/v1.4.0.tar.gz" + sha256: "650c135be0bdc5bcae6876864b8279f15b1b97069da944ec2c773cacdea27e27" + "1.3.0": + url: "https://github.com/martinmoene/string-view-lite/archive/v1.3.0.tar.gz" + sha256: "d83adb0495ccfba50ae5a1af70bde04f33a26dc40599b0ce9e55f09c075daf23" diff --git a/recipes/string-view-lite/all/conanfile.py b/recipes/string-view-lite/all/conanfile.py index 086220a931878..e5b8951774abb 100644 --- a/recipes/string-view-lite/all/conanfile.py +++ b/recipes/string-view-lite/all/conanfile.py @@ -1,15 +1,17 @@ -import os from conans import ConanFile, tools +import os + +required_conan_version = ">=1.43.0" -required_conan_version = ">=1.28.0" class StringViewLite(ConanFile): name = "string-view-lite" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/martinmoene/string-view-lite" description = "string-view lite - A C++17-like string_view for C++98, C++11 and later in a single-file header-only library" - topics = ("conan", "cpp98", "cpp11", "cpp14", "cpp17", "string-view", "string-view-implementations") + topics = ("cpp98", "cpp11", "cpp14", "cpp17", "string-view", "string-view-implementations") license = "BSL-1.0" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property @@ -20,18 +22,22 @@ def package_id(self): self.info.header_only() def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) def package(self): self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include")) self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "string-view-lite") + self.cpp_info.set_property("cmake_target_name", "nonstd::string-view-lite") + + # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.filenames["cmake_find_package"] = "string-view-lite" self.cpp_info.filenames["cmake_find_package_multi"] = "string-view-lite" self.cpp_info.names["cmake_find_package"] = "nonstd" self.cpp_info.names["cmake_find_package_multi"] = "nonstd" self.cpp_info.components["stringviewlite"].names["cmake_find_package"] = "string-view-lite" self.cpp_info.components["stringviewlite"].names["cmake_find_package_multi"] = "string-view-lite" + self.cpp_info.components["stringviewlite"].set_property("cmake_target_name", "nonstd::string-view-lite") diff --git a/recipes/string-view-lite/all/test_package/CMakeLists.txt b/recipes/string-view-lite/all/test_package/CMakeLists.txt index fe9c1664a240b..731589fe6f0d4 100644 --- a/recipes/string-view-lite/all/test_package/CMakeLists.txt +++ b/recipes/string-view-lite/all/test_package/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +conan_basic_setup(TARGETS) find_package(string-view-lite REQUIRED CONFIG) diff --git a/recipes/string-view-lite/all/test_package/conanfile.py b/recipes/string-view-lite/all/test_package/conanfile.py index abcaeed3f89b6..38f4483872d47 100644 --- a/recipes/string-view-lite/all/test_package/conanfile.py +++ b/recipes/string-view-lite/all/test_package/conanfile.py @@ -1,9 +1,9 @@ -import os from conans import ConanFile, CMake, tools +import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" + settings = "os", "arch", "compiler", "build_type" generators = "cmake", "cmake_find_package_multi" def build(self): @@ -12,6 +12,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): + if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") self.run(bin_path, run_environment=True) diff --git a/recipes/string-view-lite/config.yml b/recipes/string-view-lite/config.yml index 62c37226e4427..db1a200c33e1b 100644 --- a/recipes/string-view-lite/config.yml +++ b/recipes/string-view-lite/config.yml @@ -1,9 +1,9 @@ versions: - "1.3.0": - folder: all - "1.4.0": + "1.6.0": folder: all "1.5.1": folder: all - "1.6.0": + "1.4.0": + folder: all + "1.3.0": folder: all