Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ jobs:
- name: Install requirements
run: brew install googletest cmake
- uses: actions/checkout@v3
- run: make all && make test
- name: Run make tests
run: |
export PKG_CONFIG_PATH="$(brew --prefix)/lib/pkgconfig:$(brew --prefix googletest)/lib/pkgconfig:$PKG_CONFIG_PATH"
make all && make test

- name: test with CMake (-DSIMPLEINI_USE_SYSTEM_GTEST=OFF)
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14)

project(
SimpleIni
VERSION 4.22
VERSION 4.23
DESCRIPTION "Cross-platform C++ library providing a simple API to read and write INI-style configuration files"
LANGUAGES CXX
)
Expand Down
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,76 @@ A cross-platform library that provides a simple API to read and write INI-style

Full documentation of the interface is available in doxygen format. See [latest documentation here](https://brofield.github.io/simpleini/).

# Installation

SimpleIni is a header-only library. No building is required to use it in your project.

Simply include `SimpleIni.h` in your source files:

```c++
#include "SimpleIni.h"
```

That's it! The library is ready to use.

# Building and Testing

While the library itself doesn't require building, you can build and run the test suite using CMake.

## Building with CMake

```bash
# Configure the project
cmake -S . -B build

# Build the tests (optional)
cmake --build build
```

## Running Tests

After building, run the tests with:

```bash
# Run all tests
cd build
ctest

# Or run with verbose output
ctest --verbose

# Or run tests directly
cd tests
./simpleini-tests
```

## CMake Integration

To use SimpleIni in your CMake project:

```cmake
# Add SimpleIni as a subdirectory
add_subdirectory(simpleini)

# Link against your target
target_link_libraries(your_target PRIVATE SimpleIni::SimpleIni)
```

Or install it system-wide:

```bash
cmake -S . -B build
cmake --build build
sudo cmake --install build
```

Then in your CMake project:

```cmake
find_package(SimpleIni REQUIRED)
target_link_libraries(your_target PRIVATE SimpleIni::SimpleIni)
```

# Examples

These snippets are included with the distribution in the automatic tests as ts-snippets.cpp.
Expand Down
2 changes: 1 addition & 1 deletion SimpleIni.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<tr><th>File <td>SimpleIni.h
<tr><th>Author <td>Brodie Thiesfield
<tr><th>Source <td>https://github.com/brofield/simpleini
<tr><th>Version <td>4.22
<tr><th>Version <td>4.23
</table>

Jump to the @link CSimpleIniTempl CSimpleIni @endlink interface documentation.
Expand Down
3 changes: 1 addition & 2 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CXX?=g++
CXXFLAGS+=-Wall -std=c++14 `pkg-config --cflags gtest_main`
CXXFLAGS+=-Wall -std=c++17 `pkg-config --cflags gtest_main`
LDFLAGS+=`pkg-config --libs gtest_main`

OBJS=ts-roundtrip.o ts-snippets.o ts-utf8.o ts-bugfix.o ts-quotes.o ts-noconvert.o
Expand All @@ -18,4 +18,3 @@ test: $(BIN)
$(BIN)

$(OBJS): ../SimpleIni.h

Loading