2 Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities.
6 * parsing command-line arguments and providing Bash completion
7 * dealing with dates and times
8 * conversion of primitive data types to byte-buffers and vice versa (litte-endian and big-endian)
9 * common string conversions/operations, eg.
10 - character set conversion via iconv
11 - split, join, find and replace
12 - conversion from number to string and vice verca
13 - encoding/decoding base-64
14 - building string without multiple heap allocations (string builder)
16 - reading/writing primitive data types of various sizes (little-endian and big-endian)
17 - reading/writing terminated strings and size-prefixed strings
18 - reading/writing INI files
20 * building with CMake by providing some modules and templates
24 #### Build-only dependencies
25 * C++ compiler supporting C++14, tested with
30 * CMake (at least 3.3.0)
31 * cppunit for unit tests (optional)
32 * Doxygen for API documentation (optional)
33 * Graphviz for diagrams in the API documentation (optional)
35 #### Runtime dependencies
36 * The c++utilities library itself only needs
37 - C/C++ standard library supporting C++14
38 - libiconv (might be part of glibc or provided as extra library)
39 * For dependencies of my other projects check the README.md of these projects.
44 cd "path/to/build/directory"
45 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/final/install/location" "path/to/projectdirectory"
47 make check # build and run unit tests (optional)
48 make c++utilities_apidoc # build API documentation (optional)
49 make DESTDIR="/temporary/install/location" install
53 * Building with qmake is not supported anymore.
54 * The make option ```-j``` can be used for concurrent compilation.
55 * ```LIB_SUFFIX```, ```LIB_SUFFIX_32``` and ```LIB_SUFFIX_64``` can be set to
56 specify a suffix for the library directory, eg. lib*64* or lib*32*. The 32/64 variants are only used when building for 32/64-bit architecture.
57 * By default the build system will *build* shared libs. To *build* also static libraries, set `ENABLE_STATIC_LIBS=ON`. To disable building shared libs
58 set `DISABLE_SHARED_LIBS=ON`.
59 * By default the build system will prefer *linking against* shared libraries. To force *linking against* static libraries set `STATIC_LINKAGE=ON`.
60 However, this will only affect applications. To force linking statically when building shared libraries set `STATIC_LIBRARY_LINKAGE=ON`.
62 #### Building for Windows
63 Building for Windows with Mingw-w64 cross compiler can be utilized using a small
64 [cmake wrapper from Fedora](https://aur.archlinux.org/cgit/aur.git/tree/mingw-cmake.sh?h=mingw-w64-cmake):
66 ${_arch}-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/final/install/location" "path/to/source/directory"
67 make DESTDIR="/temporary/install/location" install-mingw-w64-strip
69 * To create the \*.ico file for the application icon ffmpeg/avconv is required.
70 * The target ```install-mingw-w64-strip``` in the example will only install files
71 suitable for creating a cross-compiler package and additionally strip the binaries.
73 #### Development builds
74 During development I find it useful to build all required projects (for instace c++utilities, qtutilities, tagparser and tageditor) as one big project.
76 This can be easily achieved by using CMake's ```add_subdirectory()``` function. For project files
77 see the repository [subdirs](https://github.com/Martchus/subdirs). For an example, see
78 [build instructions for Syncthing Tray](https://github.com/Martchus/syncthingtray#building-this-straight).
80 For a debug build, just use ```-DCMAKE_BUILD_TYPE=Debug```.
82 #### Arch Linux package
83 The repository [PKGBUILDs](https://github.com/Martchus/PKGBUILDs) contains files
84 for building Arch Linux packages.
86 PKGBUILD files to build for Windows using the Mingw-w64 compiler are also included.
89 RPM \*.spec files can be found at [openSUSE Build Servide](https://build.opensuse.org/project/show/home:mkittler).
90 Those files have only been tested under Tumbleweed so far.
93 Packages are provided by perfect7gentleman; checkout his [repository](https://github.com/perfect7gentleman/pg_overlay).
96 Scripts to build with Cygwin are provided by svnpenn. Checkout his
97 [repository](https://github.com/svnpenn/glade).
100 * There is a workaround for [GCC Bug 66145](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66145) provided
101 in io/catchiofailure.h.
104 - remove unused features