diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 63251a3..91d3bd5 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -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: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b96f82..1b25020 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ) diff --git a/README.md b/README.md index ea2f618..ea60335 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/SimpleIni.h b/SimpleIni.h index 386f446..afbc87e 100644 --- a/SimpleIni.h +++ b/SimpleIni.h @@ -5,7 +5,7 @@ File SimpleIni.h Author Brodie Thiesfield Source https://github.com/brofield/simpleini - Version 4.22 + Version 4.23 Jump to the @link CSimpleIniTempl CSimpleIni @endlink interface documentation. diff --git a/tests/Makefile b/tests/Makefile index 4e7b056..63e147f 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -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 @@ -18,4 +18,3 @@ test: $(BIN) $(BIN) $(OBJS): ../SimpleIni.h -