Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: add 3.17.3 + 3.17.2 + 3.16.7 #1761

Merged
merged 6 commits into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
38 changes: 13 additions & 25 deletions recipes/cmake/all/conanfile.py → recipes/cmake/3.x.x/conanfile.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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):
Expand All @@ -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()
Expand Down
20 changes: 13 additions & 7 deletions recipes/cmake/config.yml
Original file line number Diff line number Diff line change
@@ -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"