conan.tools.layout
Available since: 1.37.0
LayoutPackager
The LayoutPackager
together with the package layouts feature, allow to automatically
package the files following the declared information in the layout()
method:
It will copy (being xxx => build
and source
(if destination is only one dir):
Files from
self.cpp.xxx.includedirs
toself.cpp.package.includedirs
matchingself.patterns.xxx.include
patterns.Files from
self.cpp.xxx.libdirs
toself.cpp.package.libdirs
matchingself.patterns.xxx.lib
patterns.Files from
self.cpp.xxx.bindirs
toself.cpp.package.bindirs
matchingself.patterns.xxx.bin
patterns.Files from
self.cpp.xxx.srcdirs
toself.cpp.package.srcdirs
matchingself.patterns.xxx.src
patterns.Files from
self.cpp.xxx.builddirs
toself.cpp.package.builddirs
matchingself.patterns.xxx.build
patterns.Files from
self.cpp.xxx.resdirs
toself.cpp.package.resdirs
matchingself.patterns.xxx.res
patterns.Files from
self.cpp.xxx.frameworkdirs
toself.cpp.package.frameworkdirs
matchingself.patterns.xxx.framework
patterns.
Usage:
from conans import ConanFile
from conan.tools.layout import LayoutPackager
class Pkg(ConanFile):
def layout(self):
...
def package(self):
LayoutPackager(self).package()