From 91fddf3eb5bfeae65ae46c097ff1ac5dc598d2b1 Mon Sep 17 00:00:00 2001 From: Croydon Date: Tue, 21 Apr 2020 15:19:37 +0200 Subject: [PATCH 1/6] cmake: Move files to 3.x.x folder --- recipes/cmake/{all => 3.x.x}/CMakeLists.txt | 0 recipes/cmake/{all => 3.x.x}/conandata.yml | 0 recipes/cmake/{all => 3.x.x}/conanfile.py | 2 +- .../cmake/{all => 3.x.x}/test_package/conanfile.py | 0 recipes/cmake/config.yml | 14 +++++++------- 5 files changed, 8 insertions(+), 8 deletions(-) rename recipes/cmake/{all => 3.x.x}/CMakeLists.txt (100%) rename recipes/cmake/{all => 3.x.x}/conandata.yml (100%) rename recipes/cmake/{all => 3.x.x}/conanfile.py (97%) rename recipes/cmake/{all => 3.x.x}/test_package/conanfile.py (100%) 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 100% rename from recipes/cmake/all/conandata.yml rename to recipes/cmake/3.x.x/conandata.yml diff --git a/recipes/cmake/all/conanfile.py b/recipes/cmake/3.x.x/conanfile.py similarity index 97% rename from recipes/cmake/all/conanfile.py rename to recipes/cmake/3.x.x/conanfile.py index a34a8534f76e6..c837736fb8fa2 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): 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..49a5b4f9e5b7e 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -1,15 +1,15 @@ 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: a"3.x.x" "3.16.5": - folder: all + folder: "3.x.x" "3.16.6": - folder: all + folder: "3.x.x" "3.17.0": - folder: all + folder: "3.x.x" "3.17.1": - folder: all + folder: "3.x.x" From c5a5a1ec6159227ba95a16f92e0bb376719904ab Mon Sep 17 00:00:00 2001 From: Croydon Date: Thu, 28 May 2020 00:59:51 +0200 Subject: [PATCH 2/6] cmake: add 3.16.7 + 3.17.2 --- recipes/cmake/3.x.x/conandata.yml | 6 ++++++ recipes/cmake/config.yml | 18 +++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/recipes/cmake/3.x.x/conandata.yml b/recipes/cmake/3.x.x/conandata.yml index 6d824b4e633a8..22eedd996398e 100644 --- a/recipes/cmake/3.x.x/conandata.yml +++ b/recipes/cmake/3.x.x/conandata.yml @@ -14,9 +14,15 @@ 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 diff --git a/recipes/cmake/config.yml b/recipes/cmake/config.yml index 49a5b4f9e5b7e..4fb3b9c96eaf4 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -1,15 +1,19 @@ versions: "3.16.2": - folder: "3.x.x" + folder: all "3.16.3": - folder: "3.x.x" + folder: all "3.16.4": - folder: a"3.x.x" + folder: all "3.16.5": - folder: "3.x.x" + folder: all "3.16.6": - folder: "3.x.x" + folder: all + "3.16.7": + folder: all "3.17.0": - folder: "3.x.x" + folder: all "3.17.1": - folder: "3.x.x" + folder: all + "3.17.2": + folder: all From 0ad4fd3fc4485da1b3ae8ab3c6cf8e7b3eaf2a3c Mon Sep 17 00:00:00 2001 From: Croydon Date: Fri, 20 Mar 2020 17:31:20 +0100 Subject: [PATCH 3/6] cmake: Use cache for faster builds --- recipes/cmake/3.x.x/conanfile.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/recipes/cmake/3.x.x/conanfile.py b/recipes/cmake/3.x.x/conanfile.py index c837736fb8fa2..60a16742d3ffe 100644 --- a/recipes/cmake/3.x.x/conanfile.py +++ b/recipes/cmake/3.x.x/conanfile.py @@ -16,6 +16,7 @@ class CMakeConan(ConanFile): settings = "os_build", "arch_build", "compiler", "arch" _source_subfolder = "source_subfolder" + _cmake = None @property def _arch(self): @@ -38,13 +39,14 @@ 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_build == "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": From c270a7f4fce01264475e03e0803a2ac028f35863 Mon Sep 17 00:00:00 2001 From: Croydon Date: Thu, 28 May 2020 01:14:10 +0200 Subject: [PATCH 4/6] cmake: fix folder name --- recipes/cmake/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/recipes/cmake/config.yml b/recipes/cmake/config.yml index 4fb3b9c96eaf4..0eb454cc9d44c 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -1,19 +1,19 @@ 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: all + 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: all + folder: "3.x.x" From 612f56b2d6194f6bee096b59c49ce12883f41c3f Mon Sep 17 00:00:00 2001 From: Croydon Date: Thu, 28 May 2020 18:08:24 +0200 Subject: [PATCH 5/6] cmake: add cmake 3.17.3 --- recipes/cmake/3.x.x/conandata.yml | 3 +++ recipes/cmake/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/cmake/3.x.x/conandata.yml b/recipes/cmake/3.x.x/conandata.yml index 22eedd996398e..2271a2de5b729 100644 --- a/recipes/cmake/3.x.x/conandata.yml +++ b/recipes/cmake/3.x.x/conandata.yml @@ -26,3 +26,6 @@ sources: "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/config.yml b/recipes/cmake/config.yml index 0eb454cc9d44c..cdab9cce1a221 100644 --- a/recipes/cmake/config.yml +++ b/recipes/cmake/config.yml @@ -17,3 +17,5 @@ versions: folder: "3.x.x" "3.17.2": folder: "3.x.x" + "3.17.3": + folder: "3.x.x" From 7a35663056e60dc1b0f95deb1478d768e8af5059 Mon Sep 17 00:00:00 2001 From: Croydon Date: Thu, 28 May 2020 18:20:13 +0200 Subject: [PATCH 6/6] cmake: use os, arch and build_type --- recipes/cmake/3.x.x/conanfile.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/recipes/cmake/3.x.x/conanfile.py b/recipes/cmake/3.x.x/conanfile.py index 60a16742d3ffe..ba42e2ba1ffee 100644 --- a/recipes/cmake/3.x.x/conanfile.py +++ b/recipes/cmake/3.x.x/conanfile.py @@ -13,24 +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" _cmake = None - @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") - 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): @@ -42,26 +34,20 @@ def _configure_cmake(self): if not self._cmake: self._cmake = CMake(self) self._cmake.definitions["CMAKE_BOOTSTRAP"] = False - if self.settings.os_build == "Linux": + 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()