diff --git a/recipes/cmake/all/CMakeLists.txt b/recipes/cmake/3.x.x/CMakeLists.txt similarity index 100% rename from recipes/cmake/all/CMakeLists.txt rename to recipes/cmake/3.x.x/CMakeLists.txt diff --git a/recipes/cmake/all/conandata.yml b/recipes/cmake/3.x.x/conandata.yml similarity index 70% rename from recipes/cmake/all/conandata.yml rename to recipes/cmake/3.x.x/conandata.yml index 6d824b4e633a8..2271a2de5b729 100644 --- a/recipes/cmake/all/conandata.yml +++ b/recipes/cmake/3.x.x/conandata.yml @@ -14,9 +14,18 @@ sources: "3.16.6": sha256: 6f6ff1a197851b0fa8412ff5de602e6717a4eb9509b2c385b08589c4e7a16b62 url: https://cmake.org/files/v3.16/cmake-3.16.6.tar.gz + "3.16.7": + sha256: 5f49c95a2933b1800f14840f3a389f4cef0b19093985a35053b43f38ec21358f + url: https://cmake.org/files/v3.16/cmake-3.16.7.tar.gz "3.17.0": sha256: b74c05b55115eacc4fa2b77a814981dbda05cdc95a53e279fe16b7b272f00847 url: https://cmake.org/files/v3.17/cmake-3.17.0.tar.gz "3.17.1": sha256: 3aa9114485da39cbd9665a0bfe986894a282d5f0882b1dea960a739496620727 url: https://cmake.org/files/v3.17/cmake-3.17.1.tar.gz + "3.17.2": + sha256: fc77324c4f820a09052a7785549b8035ff8d3461ded5bbd80d252ae7d1cd3aa5 + url: https://cmake.org/files/v3.17/cmake-3.17.2.tar.gz + "3.17.3": + sha256: 0bd60d512275dc9f6ef2a2865426a184642ceb3761794e6b65bff233b91d8c40 + url: https://cmake.org/files/v3.17/cmake-3.17.3.tar.gz diff --git a/recipes/cmake/all/conanfile.py b/recipes/cmake/3.x.x/conanfile.py similarity index 65% rename from recipes/cmake/all/conanfile.py rename to recipes/cmake/3.x.x/conanfile.py index a34a8534f76e6..ba42e2ba1ffee 100644 --- a/recipes/cmake/all/conanfile.py +++ b/recipes/cmake/3.x.x/conanfile.py @@ -1,7 +1,7 @@ import os from conans import tools, ConanFile, CMake from conans.tools import Version -from conans.errors import ConanInvalidConfiguration, NotFoundException, ConanException +from conans.errors import ConanInvalidConfiguration, ConanException class CMakeConan(ConanFile): @@ -13,23 +13,16 @@ class CMakeConan(ConanFile): license = "BSD-3-Clause" exports_sources = ["CMakeLists.txt"] generators = "cmake" - settings = "os_build", "arch_build", "compiler", "arch" + settings = "os", "arch", "build_type" _source_subfolder = "source_subfolder" - - @property - def _arch(self): - return self.settings.get_safe("arch_build") or self.settings.get_safe("arch") - - @property - def _os(self): - return self.settings.get_safe("os_build") or self.settings.get_safe("os") + _cmake = None def _minor_version(self): return ".".join(str(self.version).split(".")[:2]) def configure(self): - if self._os == "Macos" and self._arch == "x86": + if self.settings.os == "Macos" and self.settings.arch == "x86": raise ConanInvalidConfiguration("CMake does not support x86 for macOS") def source(self): @@ -38,28 +31,23 @@ def source(self): os.rename(extracted_dir, self._source_subfolder) def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["CMAKE_BOOTSTRAP"] = False - if self.settings.os_build == "Linux": - cmake.definitions["OPENSSL_USE_STATIC_LIBS"] = True - cmake.definitions["CMAKE_EXE_LINKER_FLAGS"] = "-lz" - cmake.configure(source_dir=self._source_subfolder) - return cmake + if not self._cmake: + self._cmake = CMake(self) + self._cmake.definitions["CMAKE_BOOTSTRAP"] = False + if self.settings.os == "Linux": + self._cmake.definitions["OPENSSL_USE_STATIC_LIBS"] = True + self._cmake.definitions["CMAKE_EXE_LINKER_FLAGS"] = "-lz" + self._cmake.configure(source_dir=self._source_subfolder) + return self._cmake def build(self): - if self.settings.os_build == "Linux": + if self.settings.os == "Linux": tools.replace_in_file(os.path.join(self._source_subfolder, "Utilities", "cmcurl", "CMakeLists.txt"), "list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})", "list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} -ldl -lpthread)") - self.settings.arch = self.settings.arch_build # workaround for cross-building to get the correct arch during the build cmake = self._configure_cmake() cmake.build() - def package_id(self): - self.info.include_build_settings() - del self.info.settings.arch - del self.info.settings.compiler - def package(self): self.copy("Copyright.txt", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() diff --git a/recipes/cmake/all/test_package/conanfile.py b/recipes/cmake/3.x.x/test_package/conanfile.py similarity index 100% rename from recipes/cmake/all/test_package/conanfile.py rename to recipes/cmake/3.x.x/test_package/conanfile.py diff --git a/recipes/cmake/config.yml b/recipes/cmake/config.yml index b2c21fba0e321..cdab9cce1a221 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -1,15 +1,21 @@ versions: "3.16.2": - folder: all + folder: "3.x.x" "3.16.3": - folder: all + folder: "3.x.x" "3.16.4": - folder: all + folder: "3.x.x" "3.16.5": - folder: all + folder: "3.x.x" "3.16.6": - folder: all + folder: "3.x.x" + "3.16.7": + folder: "3.x.x" "3.17.0": - folder: all + folder: "3.x.x" "3.17.1": - folder: all + folder: "3.x.x" + "3.17.2": + folder: "3.x.x" + "3.17.3": + folder: "3.x.x"