-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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>; | ||
|
||
|