Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update README to match new CPM.cmake syntax #30

Merged
merged 1 commit into from
Dec 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,31 @@ To disable using _cmake_format_ to format CMake files, set the cmake option `FOR

## How to integrate

### Using [CPM.cmake](https://github.com/TheLartians/CPM) (recommended)
### Using [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) (recommended)

Run the following from the project's root directory to add CPM to your project.
#### Basic configuration

```bash
mkdir -p cmake
wget -O cmake/CPM.cmake https://raw.githubusercontent.com/TheLartians/CPM/master/cmake/CPM.cmake
After [adding CPM.cmake](https://github.com/cpm-cmake/CPM.cmake#adding-cpm), add the following line to the project's `CMakeLists.txt` after calling `project(...)`.

```cmake
include(cmake/CPM.cmake)
CPMAddPackage("gh:TheLartians/Format.cmake@1.7.3")
```

Add the following lines to the project's `CMakeLists.txt` after calling `project(...)`.
#### Advanced configuration

```CMake
include(cmake/CPM.cmake)
This package supports optional parameters that you can specify in the CPM.cmake `OPTIONS` argument.

```CMake
CPMAddPackage(
NAME Format.cmake
VERSION 1.7.0
VERSION 1.7.3
GITHUB_REPOSITORY TheLartians/Format.cmake
OPTIONS # set to yes skip cmake formatting
"FORMAT_SKIP_CMAKE NO"
# path to exclude (optional, supports regular expressions)
"CMAKE_FORMAT_EXCLUDE cmake/CPM.cmake"
OPTIONS
# set to yes skip cmake formatting
"FORMAT_SKIP_CMAKE NO"
# path to exclude (optional, supports regular expressions)
"CMAKE_FORMAT_EXCLUDE cmake/CPM.cmake"
)
```

Expand Down