mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-16 08:27:31 +08:00
doc: add doc about CPM
This commit is contained in:
15
README.md
15
README.md
@@ -109,7 +109,7 @@ include(FetchContent)
|
|||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
toml11
|
toml11
|
||||||
GIT_REPOSITORY https://github.com/ToruNiina/toml11.git
|
GIT_REPOSITORY https://github.com/ToruNiina/toml11.git
|
||||||
GIT_TAG v4.0.3
|
GIT_TAG v4.1.0
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(toml11)
|
FetchContent_MakeAvailable(toml11)
|
||||||
|
|
||||||
@@ -117,6 +117,19 @@ add_executable(main main.cpp)
|
|||||||
target_link_libraries(main PRIVATE toml11::toml11)
|
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/toml11@4.1.0")
|
||||||
|
|
||||||
|
add_executable(main main.cpp)
|
||||||
|
target_link_libraries(main PUBLIC toml11::toml11)
|
||||||
|
```
|
||||||
|
|
||||||
### Install Using CMake
|
### Install Using CMake
|
||||||
|
|
||||||
You can install toml11 using CMake with the following steps:
|
You can install toml11 using CMake with the following steps:
|
||||||
|
13
README_ja.md
13
README_ja.md
@@ -114,6 +114,19 @@ add_executable(main main.cpp)
|
|||||||
target_link_libraries(main PRIVATE toml11::toml11)
|
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/toml11@4.1.0")
|
||||||
|
|
||||||
|
add_executable(main main.cpp)
|
||||||
|
target_link_libraries(main PUBLIC toml11::toml11)
|
||||||
|
```
|
||||||
|
|
||||||
### Install using CMake
|
### Install using CMake
|
||||||
|
|
||||||
以下の手順で、CMakeを使ってインストールすることができます。
|
以下の手順で、CMakeを使ってインストールすることができます。
|
||||||
|
Reference in New Issue
Block a user