conanfile.py
The conanfile.py
is the recipe file of a package, responsible for defining how to build it and consume it.
from conan import ConanFile
class HelloConan(ConanFile):
...
Important
conanfile.py recipes use a variety of attributes and methods to operate. In order to avoid collisions and conflicts, follow these rules:
Public attributes and methods, like
build()
,self.package_folder
, are reserved for Conan. Don’t use public members for custom fields or methods in the recipes.Use “protected” access for your own members, like
self._my_data
ordef _my_helper(self):
. Conan only reserves “protected” members starting with_conan
.
Contents: