Skip to content

Commit 1fd6028

Browse files
committed
Add find_package directions in README
Add directions for connecting find_package to FetchContent with the cmake code in use-fetch-content.cmake.
1 parent b4a0d47 commit 1fd6028

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

.markdownlint.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
MD033: false
44

55
# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md013.md
6-
# Conforms to .clang-format ColumnLimit
7-
# Update the comment in .clang-format if we no-longer tie these two column limits.
8-
MD013:
9-
line_length: 119
6+
MD013: false
107

118
# MD024/no-duplicate-heading : https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md
129
# Supress warning about the same heading twice unless they are in the same block

README.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ SPDX-License-Identifier: 2.0 license with LLVM exceptions
88
<img src="https://github.com/bemanproject/beman/blob/main/images/logos/beman_logo-beman_library_production_ready_api_may_undergo_changes.png" style="width:5%; height:auto;"> ![CI Tests](https://github.com/bemanproject/optional/actions/workflows/ci.yml/badge.svg) [![Coverage](https://coveralls.io/repos/github/bemanproject/optional/badge.svg?branch=main)](https://coveralls.io/github/bemanproject/optional?branch=main)
99
<!-- markdownlint-enable -->
1010

11-
This repository implements `std::optional` extensions targeting C++26. The `beman.optional` library aims to evaluate
12-
the stability, the usability, and the performance of these proposed changes before they are officially adopted by WG21
13-
into the C++ Working Draft. Additionally, it allows developers to use these new features before they are implemented in
14-
major standard library compilers.
11+
This repository implements `std::optional` extensions targeting C++26. The `beman.optional` library aims to evaluate the stability, the usability, and the performance of these proposed changes before they are officially adopted by WG21 into the C++ Working Draft. Additionally, it allows developers to use these new features before they are implemented in major standard library compilers.
1512

1613
**Implements**: [Give *std::optional* Range Support (P3168R2)](https://wg21.link/P3168R2) and [`std::optional<T&>` (P2988R5)](https://wg21.link/P2988R5)
1714

@@ -27,11 +24,9 @@ Documentation and associated papers are licensed with the Creative Commons Attri
2724

2825
// SPDX-License-Identifier: CC-BY-4.0
2926

30-
The intent is that the source and documentation are available for use by people implementing their own optional types
31-
as well as people using the optional presented here as-is.
27+
The intent is that the source and documentation are available for use by people implementing their own optional types as well as people using the optional presented here as-is.
3228

33-
The README itself is licensed with CC0 1.0 Universal. Copy the contents and incorporate in your own work as you see
34-
fit.
29+
The README itself is licensed with CC0 1.0 Universal. Copy the contents and incorporate in your own work as you see fit.
3530

3631
// SPDX-License-Identifier: CC0-1.0
3732

@@ -68,7 +63,7 @@ Full code can be found in [./examples/range_loop.cpp](./examples/range_loop.cpp)
6863
### optional_ref
6964

7065
The next code snippet shows optional reference support added in [`std::optional<T&>`
71-
(P2988R5)](https://wg21.link/P2988R5):
66+
(P2988)](https://wg21.link/P2988):
7267

7368
```cpp
7469
#include <beman/optional/optional.hpp>
@@ -107,8 +102,7 @@ Default build: `C++23`. Please check `etc/${compiler}-flags.cmake`.
107102

108103
### Dependencies
109104

110-
This project is mainly tested on `Ubuntu 22.04` and `Ubuntu 24.04`, but it should be as portable as CMake is. This
111-
project has no C or C++ dependencies.
105+
This project is mainly tested on `Ubuntu 22.04` and `Ubuntu 24.04`, but it should be as portable as CMake is. This project has no C or C++ dependencies.
112106

113107
Build-time dependencies:
114108

@@ -128,14 +122,29 @@ apt-get install \
128122
clang-18 clang++-18 clang-17 clang++-17
129123
```
130124

125+
<details>
126+
<summary> Build GoogleTest dependency from github.com </summary>
127+
128+
If you do not have GoogleTest installed on your development system, you may
129+
optionally configure this project to download a known-compatible release of
130+
GoogleTest from source and build it as well.
131+
132+
```shell
133+
cmake -B build -S . -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/use-fetch-content.cmake
134+
```
135+
136+
The precise version of GoogleTest that will be used is maintained in
137+
`./lockfile.json`.
138+
139+
</details>
140+
131141
### Instructions
132142

133143
Full set of supported toolchains can be found in [.github/workflows/ci.yml](.github/workflows/ci.yml).
134144

135145
#### Preset CMake Flows
136146

137-
This project strives to be as normal and simple a CMake project as possible. This build workflow in particular will
138-
work, producing a static `beman_optional` library, ready to package:
147+
This project strives to be as normal and simple a CMake project as possible. This build workflow in particular will work, producing a static `beman_optional` library, ready to package:
139148

140149
```shell
141150
# List available preset configurations:
@@ -238,14 +247,9 @@ No tests were found!!!
238247

239248
#### Pre-Commit for Linting
240249

241-
Various linting tools are configured and installed via the [pre-commit](https://pre-commit.com/) framework. This
242-
requires a working python environment, but also allows the tools, such as clang-format and cmake-lint, to be versioned
243-
on a per project basis rather than being installed globally. Version changes in lint checks often means differences in
244-
success or failure between the versions in CI and the versions used by a developer. By using the same configurations,
245-
this problem is avoided.
250+
Various linting tools are configured and installed via the [pre-commit](https://pre-commit.com/) framework. This requires a working python environment, but also allows the tools, such as clang-format and cmake-lint, to be versioned on a per project basis rather than being installed globally. Version changes in lint checks often means differences in success or failure between the versions in CI and the versions used by a developer. By using the same configurations, this problem is avoided.
246251

247-
In order to set up a python environment, using a python virtual environment can simplify maintaining different
248-
configurations between projects. There is no particular dependency on a particular python3 version.
252+
In order to set up a python environment, using a python virtual environment can simplify maintaining different configurations between projects. There is no particular dependency on a particular python3 version.
249253

250254
##### Creating and configuring a venv
251255

@@ -258,8 +262,7 @@ python3 -m venv .venv
258262
. .venv/bin/activate && exec bash
259263
```
260264

261-
This will create the venv, install the python and python development tools, and run bash with the PATH and other
262-
environment variables set to use the venv preferentially.
265+
This will create the venv, install the python and python development tools, and run bash with the PATH and other environment variables set to use the venv preferentially.
263266

264267
##### Running the linting tools
265268

@@ -291,3 +294,4 @@ Latest revision(s) of the papers can be built / found at:
291294
* issue: [#1661](https://github.com/cplusplus/papers/issues/1661)
292295
* LEWG:
293296
* Reviewed in Tokyo 2024.
297+
* Forwarded by LEWG in 2025 in Hagenberg.

0 commit comments

Comments
 (0)