Skip to content

Commit

Permalink
doc: add doc about CPM
Browse files Browse the repository at this point in the history
  • Loading branch information
ToruNiina committed Jul 22, 2024
1 parent 0072e74 commit 5727819
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,27 @@ include(FetchContent)
FetchContent_Declare(
toml11
GIT_REPOSITORY https://github.com/ToruNiina/toml11.git
GIT_TAG v4.0.3
GIT_TAG v4.1.0
)
FetchContent_MakeAvailable(toml11)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE toml11::toml11)
```

### CMake Package Manager (CPM)

After [adding cpm to your project](https://github.com/cpm-cmake/CPM.cmake?tab=readme-ov-file#adding-cpm), you can use toml11 by doing:

```cmake
include(cmake/CPM.cmake)
CPMAddPackage("gh:ToruNiina/[email protected]")
add_executable(main main.cpp)
target_link_libraries(main PUBLIC toml11::toml11)
```

### Install Using CMake

You can install toml11 using CMake with the following steps:
Expand Down
13 changes: 13 additions & 0 deletions README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,19 @@ add_executable(main main.cpp)
target_link_libraries(main PRIVATE toml11::toml11)
```

### CMake Package Manager (CPM)

[CMake package manager](https://github.com/cpm-cmake/CPM.cmake)を導入すると、以下のようにして使用することができます。

```cmake
include(cmake/CPM.cmake)
CPMAddPackage("gh:ToruNiina/[email protected]")
add_executable(main main.cpp)
target_link_libraries(main PUBLIC toml11::toml11)
```

### Install using CMake

以下の手順で、CMakeを使ってインストールすることができます。
Expand Down

0 comments on commit 5727819

Please sign in to comment.