You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update README for CPM repository naming compatibility
Clarifies that GitHub repository names must match package names, including namespace prefixes, for CPM compatibility. Updates usage examples, instructions, and project links to reflect this requirement and prevent issues with CPM's local package finding and source fetching.
Repository naming requirements may be backed out if [this CPM PR](cpm-cmake/CPM.cmake#682) lands.
The library will be automatically fetched and built as part of your project.
109
111
112
+
**Important:** For CPM compatibility, especially with `CPM_USE_LOCAL_PACKAGES`, your GitHub repository name should match the package name. For a library with package name `stlab-enum-ops`, name your repository `stlab/stlab-enum-ops`, not `stlab/enum-ops`. This ensures CPM's abbreviated syntax works correctly with both source fetching and local package finding.
113
+
110
114
#### Installation (optional)
111
115
112
116
Installation is optional and typically not required when using CPM. If you need to install your library (e.g., for system-wide deployment or use with a package manager) use:
@@ -216,6 +220,17 @@ This ensures your project uses the latest presets and CI configurations from the
216
220
217
221
### Setting Up GitHub Repository
218
222
223
+
#### Repository Naming
224
+
225
+
**Critical:** Your GitHub repository name must match your package name for CPM compatibility.
226
+
227
+
For the recommended pattern (`project(enum-ops)` with `NAMESPACE stlab`):
228
+
229
+
- Package name will be: `stlab-enum-ops`
230
+
- Repository should be: `github.com/stlab/stlab-enum-ops`
231
+
232
+
This ensures `CPMAddPackage("gh:stlab/stlab-enum-ops@1.0.0")` works correctly with both source builds and `CPM_USE_LOCAL_PACKAGES`.
233
+
219
234
#### Version Tagging
220
235
221
236
cpp-library automatically detects your library version from git tags. To version your library:
@@ -287,6 +302,7 @@ This produces:
287
302
- Target name: `enum-ops`
288
303
- Package name: `stlab-enum-ops` (used in `find_package(stlab-enum-ops)`)
289
304
- Target alias: `stlab::enum-ops` (used in `target_link_libraries()`)
305
+
- GitHub repository should be named: `stlab/stlab-enum-ops` (for CPM compatibility)
290
306
291
307
**Alternative Patterns:**
292
308
@@ -441,8 +457,10 @@ These files are generated automatically. To regenerate with the latest templates
441
457
442
458
See these projects using cpp-library:
443
459
444
-
-[stlab/enum-ops](https://github.com/stlab/enum-ops) - Type-safe operators for enums
0 commit comments