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
Copy file name to clipboardExpand all lines: README.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,6 +197,28 @@ cpp_library_setup(
197
197
- Version is automatically detected from git tags (see [Version Tagging](#version-tagging)).
198
198
- Examples using doctest should include `test` in the filename to be visible in the [C++ TestMate](https://marketplace.visualstudio.com/items?itemName=matepek.vscode-catch2-test-adapter) extension for VS Code test explorer.
199
199
200
+
### Target Naming
201
+
202
+
For `project(your-library)`, `cpp_library_setup` will create a target called `your-library`.
203
+
204
+
The utility will additionally create an alias target based on the `NAMESPACE` option: `your_namespace::your-library`.
205
+
206
+
If your project name starts with the namespace followed by a dash, the namespace in the project name is stripped from the alias target:
207
+
208
+
```cmake
209
+
cmake_minimum_required(VERSION 3.20)
210
+
project(namespace-library)
211
+
212
+
# ... CPM setup ...
213
+
214
+
cpp_library_setup(
215
+
NAMESPACE namespace
216
+
# ...
217
+
)
218
+
```
219
+
220
+
Results in `namespace-library` and `namespace::library` targets.
221
+
200
222
### Path Conventions
201
223
202
224
The template uses consistent path conventions for all file specifications:
0 commit comments