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
DESCRIPTION description # e.g., "Type-safe operators for enums"
65
65
NAMESPACE namespace # e.g., "stlab"
66
-
67
-
# Optional parameters
68
-
VERSION version_string # e.g., "1.0.0" (auto-detected from git tags if not provided)
69
-
70
-
# Header specification (one required)
71
66
HEADERS header_list # List of header files
72
-
HEADER_DIR directory # Directory to install recursively
73
-
67
+
74
68
# Optional: source specification for non-header-only libraries
75
-
SOURCES source_list # List of source files (e.g., src/*.cpp)
69
+
SOURCES source_list # List of source files (auto-detected from src/ if not provided)
76
70
77
71
# Optional features
78
72
[EXAMPLES example_list] # Example executables to build
79
73
[TESTS test_list] # Test executables to build
80
74
[DOCS_EXCLUDE_SYMBOLS symbols] # Symbols to exclude from docs
81
75
[REQUIRES_CPP_VERSION 17|20|23] # C++ version (default: 17)
82
-
[ADDITIONAL_DEPS dep_list] # Extra CPM dependencies
83
-
84
-
# Optional flags
85
-
[CUSTOM_INSTALL] # Skip default installation
86
-
[NO_PRESETS] # Skip CMakePresets.json generation
87
-
[NO_CI] # Skip CI generation (enabled by default)
88
76
[FORCE_INIT] # Force regeneration of template files
89
77
)
90
78
```
91
79
92
-
**Note**: The project name is automatically taken from `PROJECT_NAME` (set by the `project()` command). You must call `project(your-library)` before `cpp_library_setup()`.
80
+
**Note**: The project name is automatically taken from `PROJECT_NAME` (set by the `project()` command). You must call `project(your-library)` before `cpp_library_setup()`. Version is automatically detected from git tags.
93
81
94
82
## Features
95
83
### Non-Header-Only Library Support
@@ -115,6 +103,7 @@ cpp_library_setup(
115
103
-**Build isolation** with separate build directories
116
104
-**Two-mode operation**: Full infrastructure when top-level, lightweight when consumed
117
105
-**Automatic version detection**: Version is automatically extracted from git tags (e.g., `v1.2.3` becomes `1.2.3`)
106
+
-**Always-enabled features**: CI/CD, CMakePresets.json, and proper installation are always generated
118
107
119
108
### Testing Features
120
109
@@ -161,7 +150,6 @@ cpp_library_setup(
161
150
162
151
-**Automatic git tag detection**: Version is automatically extracted from the latest git tag
163
152
-**Fallback versioning**: Uses `0.0.0` if no git tag is found (with warning)
164
-
-**Manual override**: You can still specify `VERSION` parameter to override automatic detection
165
153
-**Tag format support**: Supports both `v1.2.3` and `1.2.3` tag formats
0 commit comments