README.md
1# libpotassco
2
3[![Build Status master](https://badges.herokuapp.com/travis/potassco/libpotassco?branch=master&label=master)](https://travis-ci.org/potassco/libpotassco?branch=master)
4
5libpotassco is a small C++ utility library used by various potassco projects
6that mostly provides functions and types for
7 - parsing, writing, and converting logic programs in [aspif][aspif] and smodels format,
8 - passing information between a grounder and a solver,
9 - defining and parsing command-line options and for creating command-line applications.
10
11Furthermore, it comes with the tool `lpconvert` that converts either between aspif and smodels format
12or to a human-readable text format.
13
14libpotassco is part of the potassco project. For further information please visit:
15
16 http://potassco.org/
17
18## Installation
19
20The preferred way to build libpotassco is to use [CMake][cmake]
21version 3.1 or later.
22
23The following options can be used to configure the build:
24
25 LIB_POTASSCO_BUILD_APP : whether or not to build the lpconvert tool
26 LIB_POTASSCO_BUILD_TESTS: whether or not to build unit tests
27
28For example, to build libpotassco in release mode in directory `<dir>`:
29
30 cmake -H. -B<dir>
31 cmake --build <dir>
32
33The following options can be used to configure the installation:
34
35 CMAKE_INSTALL_PREFIX : install path prefix
36 LIB_POTASSCO_INSTALL_LIB: whether or not to install libpotassco
37
38For example, to install lpconvert and libpotassco under `/home/<usr>`:
39
40 cmake -H. -B<dir> -DCMAKE_INSTALL_PREFIX=/home/<usr> -DLIB_POTASSCO_INSTALL_LIB=ON
41 cmake --build <dir> --target install
42
43To use libpotassco in a cmake-based project either:
44
45- Place the library inside your project, e.g. using [git submodules](http://git-scm.com/docs/git-submodule).
46- Call `add_subdirectory(<path_to_libpotassco>)`.
47
48or, if libpotassco is installed in `CMAKE_PREFIX_PATH`:
49- Call `find_package(potassco <major>.<minor> CONFIG)`.
50
51Finally, call `target_link_libraries(your_target PUBLIC potassco)` to link to the potassco library.
52
53## Documentation
54Source code documentation can be generated with [Doxygen][doxygen].
55Either explicitly:
56
57 cd doc/
58 doxygen
59
60or via the `doc_potassco` target when using cmake.
61
62[aspif]: http://www.cs.uni-potsdam.de/wv/pdfformat/gekakaosscwa16b.pdf "Aspif specification"
63[cmake]: https://cmake.org/
64[doxygen]: http://www.stack.nl/~dimitri/doxygen/
65