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
Add custom dependency mapping for CMake package generation
Introduces the cpp_library_map_dependency() function to allow custom find_dependency() calls for specific targets, such as Qt components requiring COMPONENTS syntax. Updates documentation and dependency generation logic to prioritize custom mappings, improving flexibility for complex dependencies in installed CMake package config files.
-**cpp-library dependencies** (matching your project's `NAMESPACE`): Automatically mapped to their package names (e.g., `stlab::copy-on-write` → `find_dependency(copy-on-write)`)
162
+
-**Other packages**: Uses the package name only by default (e.g., `PackageName::Target` → `find_dependency(PackageName)`)
163
+
164
+
**Custom dependency mappings:**
165
+
166
+
For dependencies that require special `find_dependency()` syntax (e.g., Qt with COMPONENTS), use `cpp_library_map_dependency()` to specify the exact call:
- Dependencies requiring `OPTIONAL_COMPONENTS` or other special arguments
302
+
- Dependencies where the target name pattern doesn't match the desired `find_dependency()` call
303
+
304
+
**Note:** Most common dependencies like `Threads::Threads`, `Boost::filesystem`, etc. work automatically with the default behavior and don't need mapping.
305
+
306
+
**Example:**
307
+
308
+
```cmake
309
+
# Register mappings for dependencies needing special syntax
0 commit comments