conan-io / docs Goto Github PK
View Code? Open in Web Editor NEWconan.io reStructuredText documentation
Home Page: http://docs.conan.io
License: MIT License
conan.io reStructuredText documentation
Home Page: http://docs.conan.io
License: MIT License
if "cpp_std" in self.options
produces an infinite loop :SReported by @mnowy in: conan-io/conan#511
There is a lot of tools in https://github.com/conan-io/conan/blob/develop/conans/tools.py but I can't find any documentation for them. I.e. vcvars_command is nice tool to set up VS environment. Unfortunately to find out about that tool I had to dig to the edges of internet :)
Is it possible to add some documentation that tools like this even exists inside of conan?
Currently there are many small hands-on tutorials on certain parts of a complete workflow, and I had to keep many tabs open and jump between them (tutorials, packaging, reference pages) to figure out how things fit together.
I intended to write a guide for the full development cycle, but ended up writing bits on "how things work" and realized there's still parts I don't understand (#16 package command!)
See Conan Quickstart for my initial write up, and search for TODO
for parts I wasn't certain about.
My write up may be incorrect, feel free to copy it over and fix up any technically incorrect parts (need to translate markdown to restructured text), otherwise I probably will in the future. I can fix grammar and paraphrase later as well.
I just found that in the reference chapter under Commands the conan copy
command is not documented. Has it been forgotten?
Now its not necessary to define custom findXXX files. (if you don't want it)
Possibly the best place is just before the conan test sub-section.
@dragly has contributed a qmake generator, lets document it with some example of usage
Hi, I was going through conan docs hoping to find a real quick example to upload my source to conan.io. I've a simple header only library that I plan to use in other projects with conan as package manager. The code currently builds with cmake and meson, and is compatible with meson wrapdb too so other meson users can import it into their projects. I'm only exporting a single header rang.hpp
inside include
directory of my repo.
Going through the docs, I found -
from conans import ConanFile, CMake
class HelloConan(ConanFile):
name = "rang"
version = "1.0"
settings = "os", "compiler", "build_type", "arch"
exports = "*"
// should I remove this since I don't need to build anything
def build(self):
cmake = CMake(self.settings)
self.run('cmake %s %s' % (self.conanfile_directory, cmake.command_line))
self.run("cmake --build . %s" % cmake.build_config)
def package(self):
self.copy("*.hpp", dst="include")
// and remove this too?
def package_info(self):
self.cpp_info.libs = ["hello"]
would the above conf be able to export rang.hpp
so that when user does #include "rang.hpp"
and uses conan with it, it compiles successfully?
conan-io/conan#65, courtesy of Andrew J. Ford (https://github.com/skizzay)
From conan-io/conan#78
Stackoverflow just introduced a new part of their network: A platform to provide documentation for all kinds of software development topics. Here's a direct link to the intro page.
"Things" that documentation could be generated for are sorted into tags. See for example the tags for C++, Boost or CMake. The platform is very young and good content is currently being added.
My opinion is that this new platform is realized in a very good way. It would problably help Conan to be part of it. It is possible to propose new tags on the main page. If we have created a conan-tag it will be possible to put in documentation and examples.
Currently docs and generated cmake use old all upper case ADD_LIBRARY(), change to lower
When reading the blog post http://blog.conan.io/2016/10/24/conan-at-work.html the section about the conanfile template used by several other component is really interesting and could be really useful when managing a lot of components having the same structure.
If someone could quickly show me how to do it, I would gladly write this documentation section.
Hi,
after working through the excellent introduction at: https://github.com/conan-io/docs/blob/master/examples/zmq_protobuf.rst I ran into a couple of problems with the steps as outlined in the text:
The protoc.exe-file ends up in the top folder, while the libprotoc.dll-file ends up with the other dll files in the "bin" folder. The easiest fix is to move the protoc.exe-file to the bin-folder, and call it from the work-dir like so (avoiding issues with the path for protobuf if calling protoc.exe from within the bin-folder): .\bin\protoc.exe message.proto --cpp_out="."
The dll-files are not copied into the build\bin-folder and so the server.exe and client.exe files won't run -- again the easiest fix, is to manually copy the server.exe and client.exe to the project .\bin folder (they are created in .\build\bin).
I feel that both of these issues should probably be taken care of automatically, but I'm not sure what would be the best way -- it certainly seems like the build process should copy the needed dlls to the bin-folder (as "." is sadly and insecurely always in the dll search path on windows).
Not submitting a PR, as I'm not sure if this is easily fixed by tweaking the build-scripts or if it is more of a documentation problem on Windows (ie: the change should be to the tutorial text)?
Add a snapcraft example on conan-io/conan#789 (comment)
I'll will dig into the readthedocs
guide and add appropriate documentation and maybe a blog post, as mentioned by @lasote
Having a comparison page like Gitlab has (Gitlab Comparison) could help people decide on whether Conan is the right idea.
Some cases I can think of:
My company uses mostly Linux and most developers are used to using the built-in package manager for their dependencies. When I present Conan to them I would like to have the right features on hand, so that acceptance is easier to achieve.
This issue could be a way to collect ideas - I'll create the docpage when I find some time during the next days.
And now imports (0.16.0)
This command is not documented
I removed my conan.io remote during some tests - Unfortunately I wasn't able to find the address again. After some time I stumbled across the sources where the default remotes are defined.
It would probably be better to document the default server address somewhere. Perhaps this info could be part of the conan webpage search results / package info?
With install command + copy command
Since 0.12.0 the search command works entirely different than in previous versions. It would be good to have that documented, best thing would be to have a set of examples.
Is it still possible to get all packages that are stored for a certain component?
conan uses rest api to interact with conan_server . It would be nice if these endpoints are documented somewhere , then one could make a ui on top of conan using this api ... which would make monitoring of uploaded packages easier .
When doing getting started in Linux, following steps until:
$ cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
Reports:
WARN: CONAN_COMPILER variable not set, please make sure yourself that your compiler and version matches your declared settings
WARN: CONAN_COMPILER_VERSION variable not set, please make sure yourself that your compiler version matches your declared settings
I've solved that writing this in CMakeLists.txt:
set(CONAN_COMPILER "cmake")
set(CONAN_COMPILER_VERSION "2.8")
Is this the way to proceed? Should that be included in getting started CMakeLists.txt example?
Is it possible to require a package in a conanfile.py
with some specific options? I would like to pass a shared
-option (dynamic vs. static linking) from my package to a required package. If it is possible it should be documented under
http://docs.conan.io/en/latest/reference/conanfile.html#requirements
Hello! I had a small problem using conan and clion, and as I didn't find any mention to this problem in the docs, I thought it might be useful including in the docs this approach.
The CMakeLists.txt explained in the docs as-is, makes CLion to try reading the conaninfo.txt in the CLion's internal build folders, and it won't be there (Error quoted below).
I fixed this in my project adding this line to my CMakeLists.txt, which I suggest adding to the Integrations/CLion section:
file(COPY build/conaninfo.txt DESTINATION "${CMAKE_BINARY_DIR}")
Given that I'm building in a build
directory like this:
mkdir build && cd build/
conan install ..
cmake -G Ninja ..
cmake --build .
Without the COPY
line, Clion fails to recognize the included folders, fails to compile, fails to highlight properly, etc. The error given is:
Error:Error:file failed to open for reading (No such file or directory): /home/jmmut/.CLion12/system/cmake/generated/f6d8bf47/f6d8bf47/__default__/conaninfo.txt Error:Error:Configuration Debug file failed to open for reading (No such file or directory): /home/jmmut/.CLion12/system/cmake/generated/f6d8bf47/f6d8bf47/Debug/conaninfo.txt Error:Error:Configuration Release file failed to open for reading (No such file or directory): /home/jmmut/.CLion12/system/cmake/generated/f6d8bf47/f6d8bf47/Release/conaninfo.txt Error:Error:Configuration RelWithDebInfo file failed to open for reading (No such file or directory): /home/jmmut/.CLion12/system/cmake/generated/f6d8bf47/f6d8bf47/RelWithDebInfo/conaninfo.txt Error:Error:Configuration MinSizeRel file failed to open for reading (No such file or directory): /home/jmmut/.CLion12/system/cmake/generated/f6d8bf47/f6d8bf47/MinSizeRel/conaninfo.txt
As pointed out by @mnowy in conan-io/conan#101 (comment), it is true that this important feature is undocumented, this has to be fixed.
I got this message today when using conan:
WARN: A new conan version (v0.17.0) is available in current remote. Please, upgrade conan client to avoid deprecation.
However, I could not find any instructions on how to do this, other than downloading the new version and running the installer. Is there a way to do this via CLI? If so, I don't think it's documented.
I opened this issue to post the examples @memsharded requested in conan-io/conan#316
Probably the easiest way to demonstrate the installation method that the PR conan-io/conan#316 enables is to provide a modified version of the hello package project described in the docs.
By adding the following lines at the end of the liststfile
INSTALL(TARGETS hello
ARCHIVE DESTINATION "lib")
INSTALL(FILES "hello.h"
DESTINATION "include")
and by modifying the build
and package
methods as described in conan-io/conan#316, the package would end up installing exactly the same files as before, and the hello-use project would be able to use it without any changes.
So the entire modified CMakeLists.txt
file of the hello project would be:
PROJECT(MyHello)
cmake_minimum_required(VERSION 2.8)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
ADD_LIBRARY(hello STATIC hello.cpp)
ADD_EXECUTABLE(greet main.cpp)
TARGET_LINK_LIBRARIES(greet hello)
IF (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
TARGET_LINK_LIBRARIES(greet stdc++)
ENDIF()
INSTALL(TARGETS hello
ARCHIVE DESTINATION "lib")
INSTALL(FILES "hello.h"
DESTINATION "include")
and the conanfile.py
would be
from conans import ConanFile, CMake
class HelloConan(ConanFile):
name = "Hello"
version = "0.1"
settings = "os", "compiler", "build_type", "arch"
exports = "*"
def build(self):
cmake = CMake(self.settings)
self.run('cmake %s %s -DCMAKE_INSTALL_PREFIX=%s' % \
(self.conanfile_directory, cmake.command_line, self.package_folder))
self.run("cmake --build . %s" % cmake.build_config)
def package(self):
self.run("cmake --build . --target install")
def package_info(self):
self.cpp_info.libs = ["hello"]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.