Skip to content

Commit

Permalink
Merge pull request #1761 from bincrafters/cmake-move-to-3
Browse files Browse the repository at this point in the history
cmake: add 3.17.3 + 3.17.2 + 3.16.7
  • Loading branch information
SSE4 authored May 29, 2020
2 parents 966d65d + 7a35663 commit 2cc6385
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 32 deletions.
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
File renamed without changes.
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"

0 comments on commit 2cc6385

Please sign in to comment.