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.includedirstoself.cpp.package.includedirsmatchingself.patterns.xxx.includepatterns.Files from
self.cpp.xxx.libdirstoself.cpp.package.libdirsmatchingself.patterns.xxx.libpatterns.Files from
self.cpp.xxx.bindirstoself.cpp.package.bindirsmatchingself.patterns.xxx.binpatterns.Files from
self.cpp.xxx.srcdirstoself.cpp.package.srcdirsmatchingself.patterns.xxx.srcpatterns.Files from
self.cpp.xxx.builddirstoself.cpp.package.builddirsmatchingself.patterns.xxx.buildpatterns.Files from
self.cpp.xxx.resdirstoself.cpp.package.resdirsmatchingself.patterns.xxx.respatterns.Files from
self.cpp.xxx.frameworkdirstoself.cpp.package.frameworkdirsmatchingself.patterns.xxx.frameworkpatterns.
Usage:
from conans import ConanFile
from conan.tools.layout import LayoutPackager
class Pkg(ConanFile):
def layout(self):
...
def package(self):
LayoutPackager(self).package()