Skip to content

Commit

Permalink
(#2096) Add boostdep/1.75.0 recipe
Browse files Browse the repository at this point in the history
* Add boostdep/1.73.0 recipe

* boostdep: download + install boost license

* boostdep: use requires instead of build_requires for boost

* boostdep: only allow MT+Release and discard compiler.version

* boostdep: remove settings.compiler in package_id

* boostdep: lower required boost version

* boostdep: even lower required boost version

* boostdep: bump required boost version

Co-authored-by: Uilian Ries <[email protected]>

* Revert "boostdep: bump required boost version"

This reverts commit 374e750.

* boostdep: update to boostdep/1.74.0

* boostdep: fix on MSVC with static boost

* boostdep: bump boost dependency to 1.74.0

* boostdep: bump to boostdep/1.75.0

* boostdep: don't raise Error on non-release builds

* boostdep: bump version of boost dependency

Co-authored-by: Uilian Ries <[email protected]>
  • Loading branch information
madebr and uilianries authored Jan 9, 2021
1 parent f74a12e commit 1300210
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 0 deletions.
7 changes: 7 additions & 0 deletions recipes/boostdep/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 2.8)
project(cmake_wrapper)

include(conanbuildinfo.cmake)
conan_basic_setup()

add_subdirectory(source_subfolder)
6 changes: 6 additions & 0 deletions recipes/boostdep/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sources:
1.75.0:
- url: "https://github.com/boostorg/boostdep/archive/boost-1.75.0.tar.gz"
sha256: "7eecd835eb5b0fd602ff3615a6b663b45917689386d11073d961b86710f428af"
- url: "http://www.boost.org/LICENSE_1_0.txt"
sha256: "c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566"
58 changes: 58 additions & 0 deletions recipes/boostdep/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from conans import CMake, ConanFile, tools
import os


class BoostDepConan(ConanFile):
name = "boostdep"
settings = "os", "arch", "compiler", "build_type"
description = "A tool to create Boost module dependency reports"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/boostorg/boostdep"
license = "BSL-1.0"
topics = ("conan", "boostdep", "dependency", "tree")
exports_sources = "CMakeLists.txt"
generators = "cmake"

_cmake = None

@property
def _source_subfolder(self):
return "source_subfolder"

@property
def _build_subfolder(self):
return "build_subfolder"

def requirements(self):
self.requires("boost/1.75.0")

def package_id(self):
del self.info.settings.compiler

def source(self):
tools.get(**self.conan_data["sources"][self.version][0])
os.rename("boostdep-boost-{}".format(self.version), self._source_subfolder)
license_info = self.conan_data["sources"][self.version][1]
tools.download(filename=os.path.basename(license_info["url"]), **license_info)

def _configure_cmake(self):
if self._cmake:
return self._cmake
self._cmake = CMake(self)
self._cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared
self._cmake.configure(build_folder=self._build_subfolder)
return self._cmake

def build(self):
cmake = self._configure_cmake()
cmake.build()

def package(self):
self.copy("LICENSE*", dst="licenses")
cmake = self._configure_cmake()
cmake.install()

def package_info(self):
bin_path = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bin_path))
self.deps_env_info.PATH.append(bin_path)
14 changes: 14 additions & 0 deletions recipes/boostdep/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from conans import ConanFile, tools
import os


class DefaultNameConan(ConanFile):
settings = "os", "compiler", "arch", "build_type"

def test(self):
if tools.cross_building(self.settings):
return
tools.mkdir("libs")
tools.save("Jamroot", "")
with tools.environment_append({"BOOST_ROOT": self.build_folder}):
self.run("boostdep --list-modules", run_environment=True)
3 changes: 3 additions & 0 deletions recipes/boostdep/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"1.75.0":
folder: "all"

0 comments on commit 1300210

Please sign in to comment.