view INSTALL.md @ 37:ab071d485d38 default tip @

misc: update copyright years
author David Demelier <markand@malikania.fr>
date Thu, 04 Jan 2024 10:42:26 +0100
parents 0a3e0a53da3e
children
line wrap: on
line source

libbuf INSTALL
==============

Installation instructions.

Requirements
------------

- C99 compiler.

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

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.

The test suite is available using:

	$ ctest --test-dir build

Example:

	cmake_minimum_required(VERSION 3.20)
	project(example)
	find_package(buf REQUIRED)
	add_executable(example example.c)
	target_link_libraries(example buf::libbuf)