Skip to content

Commit 5727819

Browse files
committed
doc: add doc about CPM
1 parent 0072e74 commit 5727819

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,27 @@ include(FetchContent)
109109
FetchContent_Declare(
110110
toml11
111111
GIT_REPOSITORY https://github.com/ToruNiina/toml11.git
112-
GIT_TAG v4.0.3
112+
GIT_TAG v4.1.0
113113
)
114114
FetchContent_MakeAvailable(toml11)
115115
116116
add_executable(main main.cpp)
117117
target_link_libraries(main PRIVATE toml11::toml11)
118118
```
119119

120+
### CMake Package Manager (CPM)
121+
122+
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:
123+
124+
```cmake
125+
include(cmake/CPM.cmake)
126+
127+
CPMAddPackage("gh:ToruNiina/toml11@4.1.0")
128+
129+
add_executable(main main.cpp)
130+
target_link_libraries(main PUBLIC toml11::toml11)
131+
```
132+
120133
### Install Using CMake
121134

122135
You can install toml11 using CMake with the following steps:

README_ja.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,19 @@ add_executable(main main.cpp)
114114
target_link_libraries(main PRIVATE toml11::toml11)
115115
```
116116

117+
### CMake Package Manager (CPM)
118+
119+
[CMake package manager](https://github.com/cpm-cmake/CPM.cmake)を導入すると、以下のようにして使用することができます。
120+
121+
```cmake
122+
include(cmake/CPM.cmake)
123+
124+
CPMAddPackage("gh:ToruNiina/toml11@4.1.0")
125+
126+
add_executable(main main.cpp)
127+
target_link_libraries(main PUBLIC toml11::toml11)
128+
```
129+
117130
### Install using CMake
118131

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

0 commit comments

Comments
 (0)