Reading through the conan-docs, i can find very little information about header-files. The focus seems to be entirely on retrieving built shared or static libraries. For development, i obviously need header-files of the packages that i use. One solution i came up with, was the following (in conanfile.txt)
[imports]
include, *.h -> ./include
which copies the .h files from my dependencies into my local include-folder. Problem is of course that this does not make a distinction between the different packages, and just puts all the files into the include-folder, without subdirectories. I can't really believe that this is the intended way of doing things.
How would i retrieve the header-files of my dependencies, while being able to place them in a reasonable path?
edit: I just read that it is possible to specify the package from which to copy inside the [imports]
settings. This changes a lot, as it means that a reasonable directory-structure is possible. My question still remains though, if specifying .h
files in the [imports]
is the preferred way of retrieving header-files.
If you want every package to be copied to its own folder you have different alternatives:
deploy
generator, you don't need to specify at all the imports
. Everything from all packages is copied locally. If you are not using generators (which is the recommended way to use packages) to use packages directly from the cache (also the recommended way), then, it is likely that you want to copy all packages locally. Use the -g=deploy
in the command line or conanfile to do this.folder
specifier: https://docs.conan.io/en/latest/reference/conanfile_txt.html#imports[imports]
include, *.h -> ./include @ folder=True