Skip to content

Commit 595c5eb

Browse files
committed
Update integration.md
1 parent 16db7a3 commit 595c5eb

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

docs/plugins/conan/integration.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,27 @@ You can customize this file for package metadata like name, version, and setting
2424

2525
## Migrating Existing Projects
2626

27-
If you have an existing `conanfile.py`, follow these steps.
27+
If you have an existing `conanfile.py`, back it up and run `cppython install` to generate both files. Then update your conanfile to inherit from `CPPythonBase`.
2828

29-
**TODO**
29+
```python
30+
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
31+
from conanfile_base import CPPythonBase # Import the base class
32+
33+
34+
class YourPackage(CPPythonBase): # Inherit from CPPythonBase instead of ConanFile
35+
name = "your-package"
36+
version = "1.0.0"
37+
settings = "os", "compiler", "build_type", "arch"
38+
exports = "conanfile_base.py" # Export the base file
39+
40+
def requirements(self):
41+
super().requirements() # Get CPPython managed dependencies
42+
# Add your custom requirements here
43+
# self.requires("custom-lib/1.0.0")
44+
45+
def build_requirements(self):
46+
super().build_requirements() # Get CPPython managed test dependencies
47+
# Add your custom build requirements here
48+
49+
# ... rest of your configuration
50+
```

0 commit comments

Comments
 (0)