Mercurial > libbuf
view INSTALL.md @ 29:5cbb723ad2a9
cmake: initial support
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 06 Feb 2022 17:26:18 +0100 |
parents | b7690784cd17 |
children | 44f1392dd105 |
line wrap: on
line source
libbuf INSTALL ============== Installation instructions. Requirements ------------ - C99 compiler, - POSIX make, only required to build, - POSIX user land (ar, cc, cp, mkdir, rm), to install and test. Embed ----- Copy buf.h and buf.c to your project. Installation ------------ The module is small enough to be incorporated verbatim into your project, but it still possible to install it system wide. ### Using CMake (recommended) Using [CMake][cmake] you get proper CMake package configuration files, shared libraries and `pkg-config` files. $ cmake -S . -B build -DBUILD_SHARED_LIBS=On $ cmake --build build # cmake --build build --target install Turn `BUILD_SHARED_LIBS` to *Off* if you don't want shared libraries. Then, you can import `buf` and use on of the imported targets: - `buf::libbuf`: shared if available, static otherwise, - `buf::libbuf-shared`: shared version, - `buf::libbuf-static`: static version. Example: cmake_minimum_required(VERSION 3.20) project(example) find_package(buf REQUIRED) add_executable(example example.c) target_link_libraries(example buf::libbuf) ### Using POSIX make (not recommended) POSIX make (not recommended, only static library): $ make # make install The test suite is available using: $ make tests [cmake]: http://cmake.org