Skip to content

Commit

Permalink
Merge branch 'master' into package/libtomcrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
jowr committed Jun 19, 2022
2 parents ca9500d + 8e75f72 commit 5d2f057
Show file tree
Hide file tree
Showing 46 changed files with 662 additions and 476 deletions.
27 changes: 17 additions & 10 deletions recipes/aws-c-io/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
from conans import ConanFile, CMake, tools
import os

required_conan_version = ">=1.43.0"

required_conan_version = ">=1.33.0"

class AwsCIO(ConanFile):
name = "aws-c-io"
Expand All @@ -10,8 +11,7 @@ class AwsCIO(ConanFile):
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/awslabs/aws-c-io"
license = "Apache-2.0",
exports_sources = "CMakeLists.txt"
generators = "cmake", "cmake_find_package"

settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
Expand All @@ -22,6 +22,8 @@ class AwsCIO(ConanFile):
"fPIC": True,
}

exports_sources = "CMakeLists.txt"
generators = "cmake", "cmake_find_package"
_cmake = None

@property
Expand Down Expand Up @@ -74,18 +76,23 @@ def package(self):
tools.rmdir(os.path.join(self.package_folder, "lib", "aws-c-io"))

def package_info(self):
self.cpp_info.set_property("cmake_file_name", "aws-c-io")
self.cpp_info.set_property("cmake_target_name", "AWS::aws-c-io")
# TODO: back to global scope in conan v2 once cmake_find_package* generators removed
self.cpp_info.components["aws-c-io-lib"].libs = ["aws-c-io"]
if self.settings.os == "Macos":
self.cpp_info.components["aws-c-io-lib"].frameworks.append("Security")
if self.settings.os == "Windows":
self.cpp_info.components["aws-c-io-lib"].system_libs = ["crypt32", "secur32", "shlwapi"]

# TODO: to remove in conan v2 once cmake_find_package* generators removed
self.cpp_info.filenames["cmake_find_package"] = "aws-c-io"
self.cpp_info.filenames["cmake_find_package_multi"] = "aws-c-io"
self.cpp_info.names["cmake_find_package"] = "AWS"
self.cpp_info.names["cmake_find_package_multi"] = "AWS"
self.cpp_info.components["aws-c-io-lib"].names["cmake_find_package"] = "aws-c-io"
self.cpp_info.components["aws-c-io-lib"].names["cmake_find_package_multi"] = "aws-c-io"
self.cpp_info.components["aws-c-io-lib"].libs = ["aws-c-io"]
self.cpp_info.components["aws-c-io-lib"].set_property("cmake_target_name", "AWS::aws-c-io")
self.cpp_info.components["aws-c-io-lib"].requires = ["aws-c-cal::aws-c-cal-lib", "aws-c-common::aws-c-common-lib"]

if self.settings.os == "Macos":
self.cpp_info.components["aws-c-io-lib"].frameworks.append("Security")
if self.settings.os == "Windows":
self.cpp_info.components["aws-c-io-lib"].system_libs = ["crypt32", "secur32", "shlwapi"]
if self.settings.os in ["Linux", "FreeBSD", "Android"]:
self.cpp_info.components["aws-c-io-lib"].requires.append("s2n::s2n-lib")
2 changes: 1 addition & 1 deletion recipes/aws-c-io/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1)
project(test_package LANGUAGES C)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
conan_basic_setup(TARGETS)

find_package(aws-c-io REQUIRED CONFIG)

Expand Down
4 changes: 2 additions & 2 deletions recipes/aws-c-io/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package_multi"

def build(self):
Expand All @@ -12,6 +12,6 @@ def build(self):
cmake.build()

def test(self):
if not tools.cross_building(self.settings):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
4 changes: 4 additions & 0 deletions recipes/cvplot/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"1.2.2":
url: "https://github.com/Profactor/cv-plot/archive/refs/tags/v1.2.2.tar.gz"
sha256: "a7dbc80a8ec13fa2cfdc4f1389a1eb0cb83b56f021c64214d733812d3e301bc5"
35 changes: 35 additions & 0 deletions recipes/cvplot/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from conans import ConanFile, tools
import os

required_conan_version = ">=1.43.0"


class CvPlotConan(ConanFile):
name = "cvplot"
description = "fast modular opencv plotting library"
license = "MIT"
topics = ("plot", "opencv", "diagram", "plotting")
homepage = "https://github.com/Profactor/cv-plot"
url = "https://github.com/conan-io/conan-center-index"
requires = "opencv/4.5.3"
no_copy_source = True

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

def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder)

def package(self):
self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "CvPlot", "inc"))

def package_id(self):
self.info.header_only()

def package_info(self):
self.cpp_info.defines.append("CVPLOT_HEADER_ONLY")
self.cpp_info.set_property("cmake_find_mode", "both")
self.cpp_info.names["cmake_find_package"] = "CvPlot"
self.cpp_info.names["cmake_find_package_multi"] = "CvPlot"
12 changes: 12 additions & 0 deletions recipes/cvplot/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.1)
project(test_package CXX)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(CvPlot CONFIG REQUIRED)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} CvPlot::CvPlot)

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11)
17 changes: 17 additions & 0 deletions recipes/cvplot/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from conans import ConanFile, CMake, tools
import os


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
9 changes: 9 additions & 0 deletions recipes/cvplot/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <CvPlot/cvplot.h>

using namespace CvPlot;

int main() {
Axes axes = plot(std::vector<double>{ 3, 3, 4, 6, 4, 3 }, "-o");
cv::Mat mat = axes.render(400, 600);
return 0;
}
3 changes: 3 additions & 0 deletions recipes/cvplot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"1.2.2":
folder: all
23 changes: 11 additions & 12 deletions recipes/embree3/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import textwrap

required_conan_version = ">=1.33.0"
required_conan_version = ">=1.43.0"


class EmbreeConan(ConanFile):
Expand Down Expand Up @@ -190,6 +190,7 @@ def package(self):
else:
tools.rmdir(os.path.join(self.package_folder, "bin"))

# TODO: to remove in conan v2 once cmake_find_package_* generators removed
self._create_cmake_module_alias_targets(
os.path.join(self.package_folder, self._module_file_rel_path),
{"embree": "embree::embree"}
Expand All @@ -207,21 +208,13 @@ def _create_cmake_module_alias_targets(module_file, targets):
""".format(alias=alias, aliased=aliased))
tools.save(module_file, content)

@property
def _module_subfolder(self):
return os.path.join("lib", "cmake")

@property
def _module_file_rel_path(self):
return os.path.join(self._module_subfolder,
"conan-official-{}-targets.cmake".format(self.name))
return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name))

def package_info(self):
self.cpp_info.names["cmake_find_package"] = "embree"
self.cpp_info.names["cmake_find_package_multi"] = "embree"
self.cpp_info.builddirs.append(self._module_subfolder)
self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
self.cpp_info.set_property("cmake_file_name", "embree")
self.cpp_info.set_property("cmake_target_name", "embree")

def _lib_exists(name):
return True if glob.glob(os.path.join(self.package_folder, "lib", "*{}.*".format(name))) else False
Expand All @@ -237,3 +230,9 @@ def _lib_exists(name):

if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs.extend(["dl", "m", "pthread"])

# TODO: to remove in conan v2 once cmake_find_package_* generators removed
self.cpp_info.names["cmake_find_package"] = "embree"
self.cpp_info.names["cmake_find_package_multi"] = "embree"
self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
Loading

0 comments on commit 5d2f057

Please sign in to comment.