Derplib is a collection of utility functions and classes written for C++.
These instructions will set the project up and link the libraries against your application. Note that currently only Linux platforms are officially supported.
- CMake 3.3.0+
- Any C++ compiler on Linux with support for C++11 or newer
- NOTE: Only tested with Clang and GCC
Add this project in your CMakeLists.txt
.
add_subdirectory(derplib)
This will add the following targets to your project:
derplib::base
: Collection of self-written classesderplib::container
: Custom data containersderplib::experimental
: Experimental features that are currently under developmentderplib::stdext
: Functions and classes which extend the functionality of the C++ standard libraryderplib::newlib
is now merged into this library
Link these libraries to your project using target_link_libraries(<your_project> <libraries_to_link>)
Clone this repository, and configure this project like any other CMake project.
git clone https://gitlab.com/Derppening/derplib-cpp.git
cd derplib-cpp
mkdir build
cmake ..
cmake --build .
Note that this library currently has APIs dependent on STL, meaning that if this project is compiled against libc++
,
it will not link against other projects which are compiled against libstdc++
, and vice versa. It is therefore
recommended to always compile this library as a direct dependency of your project.
Tests are automatically built if this project is built as a standalone library.
If this project is built as a CMake dependency, enable tests by adding the following line before the add_subdirectory
command:
set(DERPLIB_RUN_TESTS ON)
Tests can be run by make tests
in the root of the build
directory.
The following CMake variables can be defined to alter the build properties:
DERPLIB_BUILD_DOCS
: Whether to build Doxygen documentation (default: ON for standalone)DERPLIB_RUN_TESTS
: Whether to run the bundled tests (default: ON for standalone)DERPLIB_WARN
: Whether to display compiler warnings (default: ON for standalone)
In addition, derplib will read the CMake variable CMAKE_CXX_STANDARD
from the parent project, and compile a version of
the library with features matching the given C++ version. To override this setting, set DERPLIB_CXX_STD_OVERRIDE
to
any value accepted by CMAKE_CXX_STANDARD
. Note that this only affect compiled libraries; header-only libraries are
still affected by the C++ version as defined in the root project.
For standalone libraries, the library is set to compile in C++11 mode by default.
This project uses SemVer for versioning.