diff --git a/recipes/cvplot/all/conandata.yml b/recipes/cvplot/all/conandata.yml new file mode 100644 index 0000000000000..9079421334b14 --- /dev/null +++ b/recipes/cvplot/all/conandata.yml @@ -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" diff --git a/recipes/cvplot/all/conanfile.py b/recipes/cvplot/all/conanfile.py new file mode 100644 index 0000000000000..49ceaeafa285e --- /dev/null +++ b/recipes/cvplot/all/conanfile.py @@ -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" diff --git a/recipes/cvplot/all/test_package/CMakeLists.txt b/recipes/cvplot/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b75c35da97dea --- /dev/null +++ b/recipes/cvplot/all/test_package/CMakeLists.txt @@ -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) diff --git a/recipes/cvplot/all/test_package/conanfile.py b/recipes/cvplot/all/test_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/cvplot/all/test_package/conanfile.py @@ -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) diff --git a/recipes/cvplot/all/test_package/test_package.cpp b/recipes/cvplot/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0592129b4a676 --- /dev/null +++ b/recipes/cvplot/all/test_package/test_package.cpp @@ -0,0 +1,9 @@ +#include + +using namespace CvPlot; + +int main() { + Axes axes = plot(std::vector{ 3, 3, 4, 6, 4, 3 }, "-o"); + cv::Mat mat = axes.render(400, 600); + return 0; +} diff --git a/recipes/cvplot/config.yml b/recipes/cvplot/config.yml new file mode 100644 index 0000000000000..af40d9653a378 --- /dev/null +++ b/recipes/cvplot/config.yml @@ -0,0 +1,3 @@ +versions: + "1.2.2": + folder: all