1
0
forked from blue/lmdbal
LMDB Abstraction Layer. A library to ease interactions with LMDB
Go to file
2024-10-05 15:15:28 +00:00
.gitea/workflows workflow destination transition, some examples on title docs page 2024-03-03 20:09:06 -03:00
cmake cmake magick to make package usable and discoverable by another CMake projects, readme, pkgbuild 2023-03-22 19:30:41 +03:00
doc workflow destination transition, some examples on title docs page 2024-03-03 20:09:06 -03:00
packaging/Archlinux some cmake magick to make it work with installed paths 2024-02-04 16:10:43 -03:00
src removed lmdbal subdir from lib on installation 2024-02-04 19:49:06 -03:00
test small build adjustments 2024-02-01 13:05:49 -03:00
CHANGELOG.md lmdb calls are now compiled into .so 2023-11-14 20:15:16 -03:00
CMakeLists.txt removed lmdbal subdir from lib on installation 2024-02-04 19:49:06 -03:00
LICENSE.md Use text from fsf.org 2024-10-05 12:15:03 +00:00
README.md Specify which files are under which licenses 2024-10-05 11:26:03 +00:00

LMDBAL - Lightning Memory Data Base Abstraction Level

AUR license AUR version Liberapay patrons Documentation

Prerequisites

  • a compiler (c++ would do)
  • Qt 5 or higher (qt5-base would do)
  • lmdb
  • CMake 3.16 or higher
  • Doxygen (optional, for documentation)
  • gtest (optional, for tests)

Using with CMake

As a system library

If you're using LMDBAL as a system library you probably have no control over it's build options. The easiest way to include the project is to add following

find_package(lmdbal)
if (LMDBAL_FOUND)
    target_include_directories(yourTarget PRIVATE ${LMDBAL_INCLUDE_DIRS})
    target_link_libraries(yourTarget PRIVATE LMDBAL::LMDBAL)
endif()

As an embeded subproject

If you're using LMDBAL as a embeded library you might want to control it's build options, for example you can run

set(BUILD_STATIC ON)

before including the library in your project. This will set the library to be build in a static mode.

Then you want to run something like this

add_subdirectory(pathTo/yourEmbedded/libraries/lmdbal)
add_library(LMDBAL::LMDBAL ALIAS LMDBAL)
...

target_link_libraries(yourTarget PRIVATE LMDBAL::LMDBAL)

The headers are added as PUBLIC so you might not even need to target_link_libraries them

Building

LMDBAL uses CMake as a build system.

Please check the prerequisites and install them before building.

Here is an easy way to build a project

$ git clone https://git.macaw.me/blue/lmdbal
$ cd lmdbal
$ mkdir build
$ cd build
$ cmake .. [ *optional keys* ]
$ cmake --build .
$ cmake --install . --prefix install

This way will create you a lmdbal/build directory with temporary files, and lmdbal/build/install with all the export files for installation to the system.

After cmake .. you can specify keys to alter the building process. In this context building keys are transfered like so

cmake .. -D KEY1=VALUE1 -D KEY2=VALUE2 ...

List of keys

Here is the list of keys you can pass to configuration phase of cmake ..:

  • CMAKE_BUILD_TYPE - Debug just builds showing all warnings, Release builds with no warnings and applies optimizations (default is Debug);
  • BUILD_STATIC - True builds project as a static library, False builds as dynamic (default is False);
  • BUILD_TESTS - True build unit tests, False does not (default is False);
  • BUILD_DOC - True build doxygen documentation, False does not (default is False);
  • BUILD_DOXYGEN_AWESOME - True build doxygen awesome theme if BUILD_DOC is also True (default is False);
  • QT_VERSION_MAJOR - 5 links against Qt5, 6 links agains Qt6, there is no default, so, if you didn't specify it the project will chose automatically;

Running tests

If you built the library with -D BUILD_TESTS=True, then there will be lmdbal/build/tests/runUnitTests executable file. You can simply run it as

./runUnitTests

if you're in the same directory with it

License

This project is available under the GPL-3.0 License or any later version. The file cmake/FindLMDB.cmake is available under the GPL-3.0 License only, - see the LICENSE.md file for details