|
CookMem 1.4.0
A C++ memory context / allocator
|
CookMem is a collection of C++ header files, so there are no libraries to build or link. Include cookmem.h in your code.
CookMem provides the CMake target cookmem::cookmem. Linking it adds the CookMem include directory and requires C++11:
Use one of the following to make the target available. They require CMake 3.14 or later.
FetchContent downloads CookMem when your project is configured:
add_subdirectory uses a copy of CookMem inside your project, such as a Git submodule:
find_package uses an installed copy of CookMem. To install it:
Then, in your project:
If CookMem is not installed in a standard location, pass -DCMAKE_PREFIX_PATH=/path/to/prefix when you configure your project. The version check accepts any release with the same major version.
With FetchContent and add_subdirectory, only the cookmem::cookmem target is created. CookMem's tests, examples and performance tests are built only when CookMem is the top-level project. The following options change that:
COOKMEM_BUILD_TESTS - build the tests, examples and performance tests. The default is ON only when CookMem is the top-level project.COOKMEM_INSTALL - generate the install rules. The default is ON only when CookMem is the top-level project.Copy cookmem.h and the cookmem/ directory from include/ into a suitable include directory.
The version of CookMem is available through the macros in cookmem/version.h, which every CookMem header includes:
COOKMEM_VERSION_MAJOR, COOKMEM_VERSION_MINOR and COOKMEM_VERSION_PATCHCOOKMEM_VERSION - a single number for comparisons, such as 10203 for 1.2.3COOKMEM_VERSION_STRING - a string such as "1.2.3"