forked from blue/lmdbal
cmake magick to make package usable and discoverable by another CMake projects, readme, pkgbuild
This commit is contained in:
parent
7377f13534
commit
f5612dc3c5
6 changed files with 161 additions and 22 deletions
77
README.md
Normal file
77
README.md
Normal file
|
@ -0,0 +1,77 @@
|
|||
# LMDBAL - Lightning Memory Data Base Abstraction Level
|
||||
|
||||
[](https://git.macaw.me/blue/lmdbal/raw/branch/master/LICENSE.md)
|
||||
[](https://aur.archlinux.org/packages/lmdbal/)
|
||||
[](https://liberapay.com/macaw.me)
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- QT 5 *(lower versions might work but it wasn't tested)*
|
||||
- lmdb
|
||||
- CMake 3.16 or higher
|
||||
|
||||
### 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
|
||||
//TODO
|
||||
|
||||
### 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`);
|
||||
- `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 licensed under the GPLv3 License - see the [LICENSE.md](LICENSE.md) file for details
|
Loading…
Add table
Add a link
Reference in a new issue