Skip to content

Commit

Permalink
doc: updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
penglei0 committed May 9, 2024
1 parent e99c10e commit 4f6705e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,26 @@ cmake --build build
cd build && ctest -C Release --output-on-failure
```

## Use it in CMake project

Add the following code in your CMakeLists.txt file.

```cmake
FetchContent_Declare(
Ini-cpp
GIT_REPOSITORY [email protected]:penglei0/Ini-cpp.git
GIT_TAG v1.0.0)
FetchContent_MakeAvailable(Ini-cpp)
message("Ini_cpp source directory is :" ${Ini-cpp_SOURCE_DIR})
message("Ini_cpp binary directory is :" ${Ini-cpp_BINARY_DIR})
include_directories(${Ini-cpp_SOURCE_DIR}/include)
```

## Example cpp code

```cpp
#include "settings.h"
#include <settings.h>
constexpr const char path[] = "/etc/cfg/my_settings.ini";
using MySettings = Settings<path>;

Expand Down

0 comments on commit 4f6705e

Please sign in to comment.