Skip to content

Commit

Permalink
(#8167) adding new package cvplot
Browse files Browse the repository at this point in the history
* added cvplot

* using del self.options.shared

* c++11 std in test_package added

* header-only only

* Use MIT short name

Co-authored-by: Uilian Ries <uilianries@gmail.com>

* more topics

Co-authored-by: Uilian Ries <uilianries@gmail.com>

* CvPlot as target name

Co-authored-by: Uilian Ries <uilianries@gmail.com>

* dont need cmake in package recipe

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>

Co-authored-by: Uilian Ries <uilianries@gmail.com>
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
  • Loading branch information
3 people authored Jan 25, 2022
1 parent 2486b31 commit c704f8c
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 0 deletions.
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

0 comments on commit c704f8c

Please sign in to comment.