-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
2486b31
commit c704f8c
Showing
6 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
"1.2.2": | ||
folder: all |