Hi,
I'm completely new to conan and relatively new to C++.
I'm trying to change the workflow of our company to use Conan (they thought it would be a good first project for the newbie).
I have successfully made my conanfile.txt with the correct requirements. One library we use wasn't jet in the bintray, but since it's an already build library I figured that I could build the package my self.
This is the package: https://bintray.com/qvandijk/conan-open/gnuplot-iostream%3Aqvandijk
Why I run conan install
I does install, but the project can't find the library. conan install
does return a warning, which I think might be the problem. But I don't understand it.
gnuplot-iostream/1.0@qvandijk/stable: Already installed!
gnuplot-iostream/1.0@qvandijk/stable: WARN: Lib folder doesn't exist, can't collect libraries: /home/kwint/.conan/data/gnuplot-iostream/1.0/qvandijk/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib
What am I doing wrong?
Since I think the problem is in my package, this is my conanfile.py, so you don't have to download it:
from conans import ConanFile
from conans import tools
class GnuplotiostreamConan(ConanFile):
name = "gnuplot-iostream"
version = "1.0"
description = "C++ interface to gnuplot"
url = "www.github.com/kwint"
repo_url = "https://github.com/dstahlke/gnuplot-iostream"
license = "None"
def build(self):
self.run("git clone https://github.com/dstahlke/gnuplot-iostream.git")
def package(self):
self.copy("*")
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
Hi! hahaha, I'm sure you will learn a lot, keep a positive point of view ;)
That library is a header only one, right? the only file to package is the "gnuplot-iostream.h", so there is no library built here, you don't have to do the collect_libs:
from conans import ConanFile
from conans import tools
class GnuplotiostreamConan(ConanFile):
name = "gnuplot-iostream"
version = "1.0"
description = "C++ interface to gnuplot"
url = "www.github.com/kwint"
repo_url = "https://github.com/dstahlke/gnuplot-iostream"
license = "None"
def source(self):
self.run("git clone https://github.com/dstahlke/gnuplot-iostream.git")
def package(self):
self.copy("*.h", dst="include")
Now other libraries can require this one and will have available the include directory poiting to the "include" directory where the gnuplot-iostream.h
lives.
I'm trying to change the workflow of our company to use Conan (they thought it would be a good first project for the newbie).
Well, it would be better for someone with some experience in building C++ and build-systems, not really necessary to be an expert in C++. For a newbie in build-systems, it can be a bit overwhelming, not because of Conan, but simply because of building C++ might be quite difficult. Don't hesitate to ask for help here if you need it, or also in the CppLang slack team (there is a #conan channel). Cheers!
Thanks @lasote! It works perfectly.
I really appreciate the friendliness of this community!
Once I get familiar enough with conan I will try to return the favor.
Most helpful comment
Thanks @lasote! It works perfectly.
I really appreciate the friendliness of this community!
Once I get familiar enough with conan I will try to return the favor.