Skip to content

Commit db8da05

Browse files
committed
Add CMake example
1 parent e445dfc commit db8da05

2 files changed

Lines changed: 64 additions & 1 deletion

File tree

docs/_sidebar.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
},
5757
"items": [
5858
"maintainer/example_recipes/go",
59-
"maintainer/example_recipes/rust"
59+
"maintainer/example_recipes/rust",
60+
"maintainer/example_recipes/cmake"
6061
]
6162
}
6263
]
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: 'CMake packages'
3+
---
4+
5+
If you want to package a CMake library to conda-forge, you can use this recipe template:
6+
7+
```yaml
8+
context:
9+
version: "1.2.3"
10+
11+
package:
12+
name: example-package
13+
version: ${{ version }}
14+
15+
source:
16+
url: https://github.com/example-package/example-package/archive/refs/tags/v${{ version }}.tar.gz
17+
sha256: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
18+
19+
build:
20+
number: 0
21+
script:
22+
content:
23+
- if: unix
24+
then:
25+
- cmake -B build -GNinja $CMAKE_ARGS .
26+
else:
27+
- cmake -B build -GNinja %CMAKE_ARGS% .
28+
- cmake --build build
29+
- cmake --install build
30+
31+
requirements:
32+
build:
33+
- ${{ stdlib('c') }}
34+
- ${{ compiler('c') }}
35+
- ${{ compiler('cxx') }} # optional
36+
- cmake
37+
- ninja
38+
host:
39+
# put any dependencies here
40+
run_exports:
41+
- ${{ pin_subpackage('example-package', upper_bound='x.x.x') }}
42+
43+
tests:
44+
- package_contents:
45+
lib:
46+
- example_package
47+
48+
about:
49+
homepage: https://github.com/example-package/example-package
50+
summary: Summary of the package.
51+
description: |
52+
Description of the package
53+
license: LGPL-3.0-or-later
54+
license_file:
55+
- COPYING
56+
documentation: https://github.com/example-package/example-package
57+
repository: https://github.com/example-package/example-package
58+
59+
extra:
60+
recipe-maintainers:
61+
- LandoCalrissian
62+
```

0 commit comments

Comments
 (0)