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

adding new package cvplot #8167

Merged
merged 8 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
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"
33 changes: 33 additions & 0 deletions recipes/cvplot/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from conans import ConanFile, tools
import os

required_conan_version = ">=1.33.0"
wpalfi marked this conversation as resolved.
Show resolved Hide resolved


class CvPlotConan(ConanFile):
name = "cvplot"
description = "fast modular opencv plotting library"
license = "MIT License"
wpalfi marked this conversation as resolved.
Show resolved Hide resolved
topics = ("plot", "opencv")
wpalfi marked this conversation as resolved.
Show resolved Hide resolved
homepage = "https://github.com/Profactor/cv-plot"
url = "https://github.com/conan-io/conan-center-index"
generators = "cmake"
wpalfi marked this conversation as resolved.
Show resolved Hide resolved
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")
wpalfi marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 10 additions & 0 deletions recipes/cvplot/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.1)
project(test_package CXX)

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

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
wpalfi marked this conversation as resolved.
Show resolved Hide resolved

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"
wpalfi marked this conversation as resolved.
Show resolved Hide resolved

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