tastytea
2fb329a302
Some checks failed
continuous-integration/drone/push Build is failing
* Compile a library again. * Made CMake recipes modular. * Added xdgcfgConfig.cmake. * Added pkg-config file. * Updated readme.
63 lines
1.5 KiB
Markdown
63 lines
1.5 KiB
Markdown
**xdgcfg** is a very simple wrapper around libconfig written in C++. It reads
|
|
and writes files in `${XDG_CONFIG_HOME}`. It creates subdirectories if
|
|
necessary.
|
|
|
|
## Usage
|
|
|
|
`xdgcfg.hpp` has explanatory comments in it and there is an
|
|
[example](src/example.cpp). The reference is also available at
|
|
[doc.schlomp.space/xdgcfg/](https://doc.schlomp.space/xdgcfg/classxdgcfg.html).
|
|
|
|
Use it in your CMake project like this:
|
|
|
|
``` cmake
|
|
find_package(xdgcfg CONFIG REQUIRED)
|
|
target_link_libraries(MyProject xdgcfg::xdgcfg)
|
|
```
|
|
|
|
If you don't use CMake, you can get the compile-flags with pkg-config:
|
|
|
|
``` shell
|
|
pkg-config --libs --cflags xdgcfg
|
|
```
|
|
|
|
## Install
|
|
|
|
### Gentoo
|
|
|
|
Add my [repository](https://schlomp.space/tastytea/overlay) and install it from
|
|
there.
|
|
|
|
``` shell
|
|
eselect repository enable tastytea
|
|
echo "dev-cpp/xdgcfg" >> /etc/portage/package.accept_keywords/xdgcfg
|
|
emaint sync -r tastytea
|
|
emerge -a dev-cpp/xdgcfg
|
|
```
|
|
|
|
### From source
|
|
|
|
### Dependencies
|
|
|
|
* C++ compiler (Tested: g++ 5/8/9)
|
|
* [cmake](https://cmake.org/) (at least: 3.1)
|
|
* [pkgconfig](https://pkgconfig.freedesktop.org/wiki/) (tested: 0.29)
|
|
* [libconfig++](https://github.com/hyperrealm/libconfig) (tested: 1.5)
|
|
* [libxdg-basedir](http://repo.or.cz/w/libxdg-basedir.git) (tested: 1.2)
|
|
|
|
### Compile
|
|
|
|
``` shell
|
|
mkdir build
|
|
cd build
|
|
cmake ..
|
|
cmake --build .
|
|
make install
|
|
```
|
|
|
|
### CMake options
|
|
|
|
* `-DWITH_TESTS=YES` to compile the tests.
|
|
* `-DWITH_EXAMPLES=YES` to compile the example.
|
|
* `-DBUILD_SHARED_LIBS=NO` to build a static library.
|