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

matplotlib-cpp/cci.20210111 #4212

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
6 changes: 6 additions & 0 deletions recipes/matplotlib-cpp/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sources:
cci.20200422:
- url: https://raw.githubusercontent.com/lava/matplotlib-cpp/d74105036a82e6ccede3fa1a7d872ac1677b00ab/matplotlibcpp.h
sha256: 913638b1d03ccfe28f58f327a8c1247aec943f88f19c37648fd01e239420fb90
- url: https://raw.githubusercontent.com/lava/matplotlib-cpp/d74105036a82e6ccede3fa1a7d872ac1677b00ab/LICENSE
sha256: d0dc4eae3be039d576e127912d16f78a7ba4e0e6205cd75103efd1a45b89a4ba
blackliner marked this conversation as resolved.
Show resolved Hide resolved
33 changes: 33 additions & 0 deletions recipes/matplotlib-cpp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from conans import ConanFile, tools
import os
import glob


class MatplotlibCppConan(ConanFile):
name = "matplotlib-cpp"
description = "Extremely simple yet powerful header-only C++ plotting library built on the popular matplotlib."
topics = ("conan", "matplotlib", "matplotlib-cpp")
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/lava/matplotlib-cpp"
license = "MIT"
no_copy_source = True

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

def source(self):
for url_sha in self.conan_data["sources"][self.version]:
tools.download(url_sha["url"], os.path.basename(url_sha["url"]))
tools.check_sha256(os.path.basename(url_sha["url"]), url_sha["sha256"])

def package(self):
self.copy(pattern="LICENSE", dst="licenses")
self.copy(pattern="matplotlibcpp.h", dst="include")

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

def package_info(self):
self.cpp_info.names["cmake_find_package"] = "matplotlib-cpp"
self.cpp_info.names["cmake_find_package_multi"] = "matplotlib-cpp"
15 changes: 15 additions & 0 deletions recipes/matplotlib-cpp/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.10)
project(test_package)

set(CMAKE_CXX_STANDARD 11)

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

find_package(matplotlib-cpp REQUIRED)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)

add_executable(test_package test_package.cpp)
target_link_libraries(test_package PRIVATE matplotlib-cpp::matplotlib-cpp ${PYTHON_LIBRARIES})
target_include_directories(test_package PRIVATE ${PYTHON_INCLUDE_DIRS})
17 changes: 17 additions & 0 deletions recipes/matplotlib-cpp/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"

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

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

int main()
{
matplotlibcpp::plot({1, 3, 2, 4});
}
3 changes: 3 additions & 0 deletions recipes/matplotlib-cpp/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
cci.20200422:
folder: "all"