|
2 | 2 |
|
3 | 3 | <!-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception --> |
4 | 4 |
|
5 | | -This repository contains the infrastructure for The Beman Project. This is NOT a library repository, so it does not |
6 | | -respect the usual structure of a Beman library repository nor The Beman Standard! |
| 5 | +This repository contains the infrastructure for The Beman Project. This is NOT a library repository, |
| 6 | +so it does not respect the usual structure of a Beman library repository nor The Beman Standard! |
7 | 7 |
|
8 | 8 | ## Description |
9 | 9 |
|
| 10 | +* `cmake/`: CMake modules and toolchain files used by Beman libraries. |
10 | 11 | * `containers/`: Containers used for CI builds and tests in the Beman org. |
11 | 12 | * `tools/`: Tools used to manage the infrastructure and the codebase (e.g., linting, formatting, etc.). |
| 13 | + |
| 14 | +## Usage |
| 15 | + |
| 16 | +This repository is intended to be used as a beman-submodule in other Beman repositories. See |
| 17 | +[the Beman Submodule documentation](./tools/beman-submodule/README.md) for details. |
| 18 | + |
| 19 | + |
| 20 | +### CMake Modules |
| 21 | + |
| 22 | + |
| 23 | +#### `beman_install_library` |
| 24 | + |
| 25 | +The CMake modules in this repository are intended to be used by Beman libraries. Use the |
| 26 | +`beman_add_install_library_config()` function to install your library, along with header |
| 27 | +files, any metadata files, and a CMake config file for `find_package()` support. |
| 28 | + |
| 29 | +```cmake |
| 30 | +add_library(beman.something) |
| 31 | +add_library(beman::something ALIAS beman.something) |
| 32 | +
|
| 33 | +# ... configure your target as needed ... |
| 34 | +
|
| 35 | +find_package(beman-install-library REQUIRED) |
| 36 | +beman_install_library(beman.something) |
| 37 | +``` |
| 38 | + |
| 39 | +Note that the target must be created before calling `beman_install_library()`. The module |
| 40 | +also assumes that the target is named using the `beman.something` convention, and it |
| 41 | +uses that assumption to derive the names to match other Beman standards and conventions. |
| 42 | +If your target does not follow that convention, raise an issue or pull request to add |
| 43 | +more configurability to the module. |
| 44 | + |
| 45 | +The module will configure the target to install: |
| 46 | + |
| 47 | +* The library target itself |
| 48 | +* Any public headers associated with the target |
| 49 | +* CMake files for `find_package(beman.something)` support |
| 50 | + |
| 51 | +Some options for the project and target will also be supported: |
| 52 | + |
| 53 | +* `BEMAN_INSTALL_CONFIG_FILE_PACKAGES` - a list of package names (e.g., `beman.something`) for which to install the config file |
| 54 | + (default: all packages) |
| 55 | +* `<BEMAN_NAME>_INSTALL_CONFIG_FILE_PACKAGE` - a per-project option to enable/disable config file installation (default: `ON` if the project is top-level, `OFF` otherwise). For instance for `beman.something`, the option would be `BEMAN_SOMETHING_INSTALL_CONFIG_FILE_PACKAGE`. |
0 commit comments