cpplot icon indicating copy to clipboard operation
cpplot copied to clipboard

Conan Support

Open SpyrosMourelatos opened this issue 5 years ago • 3 comments

As I see your project uses conan as a package manager I would like to ask if you are planning to upload a conan package on bintray or conan-center?or if you would allow me to do it

SpyrosMourelatos avatar Sep 15 '20 21:09 SpyrosMourelatos

HI @DrunkenMastah yes, I've been preparing a PR for that, it's taken them a little while to give me the required privileges (their process for open submission of packages is still quite new so I think they've been shaking down a few things).

Issue #6 is where I'm tracking this through to completion, and mentions progress with getting onto their EAP, so I'll close this one as a duplicate and you can follow along there.

In the meantime hopefully it's not too bad to download and install, let me know how you get on :)

thclark avatar Sep 15 '20 22:09 thclark

Actually I made a recipe that works locally :)


from conans import ConanFile, CMake, tools
import os
import glob

class DreadBoxTemplatePackage(ConanFile):
    name = "cpplot"
    homepage = "https://github.com/thclark/cpplot"
    url = "http:/nouri/nowhere"
    version="0.1"
    exports_sources = "CMakeLists.txt","cmake/*","include/*"
    description= "First try to package something with conan"
    generators = "cmake_paths", "cmake_find_package", "cmake"
    settings = "os", "arch", "compiler" 



    def requirements(self):
        self.requires("eigen/3.3.7")
        self.requires("nlohmann_json/3.8.0")
        self.requires("boost/1.73.0")
        self.requires("glog/0.4.0")
        self.requires("gtest/1.10.0")
        self.requires("tbb/2020.1")

    def _configure_cmake(self):
        cmake = CMake(self)
        cmake.configure(source_folder = "cpplot-master")
        return cmake

    def source(self):
        tools.get("https://github.com/thclark/cpplot/archive/master.zip")

    def package(self):
        cmake = self._configure_cmake()
        cmake.install()
        self.copy("*.h", dst="include",src= "cpplot-master/source" )



my CMakeLists looks like :

find_package(cpplot REQUIRED)
add_executable(test src/main.cpp)
target_link_libraries(test PRIVATE cpplot::cpplot )#

Don't forget to add the includes on your install command on your CmakeLists , this line seems a bit hacky
self.copy("*.h", dst="include",src= "cpplot-master/source" )

SpyrosMourelatos avatar Sep 22 '20 19:09 SpyrosMourelatos

That's helpful @DrunkenMastah - appreciate it! I have a flood of work on right now but am quite committed to this project, so will be progressing on this issue over the next month or 6 weeks.

thclark avatar Sep 24 '20 11:09 thclark