Skip to content

RaphaelCausse/cuds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CUDS - C Utilities and Data Structures

CUDS is a C library providing generic data structures, common utilities, and helper modules.


Table of Contents

  1. Requirements
  2. Configuration
  3. Build
  4. Install
  5. Usage
  6. Tests
  7. Clean
  8. Authors

Requirements

  • C99-compatible compiler (GCC, Clang, or MSVC)
  • CMake >= 3.16
  • Ninja (recommended)

Configuration

List all available configure presets:

cmake --list-presets

Configure the project, using a preset (recommended) :

cmake --preset linux-gcc-release

If you prefer to configure manually, in <BUILD_DIR> :

cmake -S . -B <BUILD_DIR> \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr/local \
    -DCUDS_BUILD_SHARED=ON \
    -DCUDS_BUILD_STATIC=OFF \
    -DCUDS_BUILD_TESTS=OFF

Notes:

  • Both static and shared libraries are built by default. Enable/Disable by setting options CUDS_BUILD_SHARED and CUDS_BUILD_STATIC at configuration.
  • Tests are built by default. Enable/Disable by setting option CUDS_BUILD_TESTS at configuration.

Build

List all available build presets:

cmake --build --list-presets

Build the project, using a preset (recommended) :

cmake --build --preset linux-gcc-release

If you prefer to build manually, in <BUILD_DIR> :

cmake --build <BUILD_DIR>

Install

Install the library and headers :

cmake --install <BUILD_DIR>

You can specify an installation prefix explicitly :

cmake --install <BUILD_DIR> --prefix <PREFIX_PATH>

Files are installed as follows :

  • Headers : <PREFIX_PATH>/include/cuds
  • Libraries : <PREFIX_PATH>/lib
  • CMake package config : <PREFIX_PATH>/lib/cmake/cuds
  • pkg-config file : <PREFIX_PATH>/lib/pkgconfig

Usage

Using CMake

# Find the installed CUDS library
find_package(cuds REQUIRED)

# Link against the shared or static library explicitly
target_link_libraries(my_target PRIVATE cuds::cuds_shared)
# or
# target_link_libraries(my_target PRIVATE cuds::cuds_static)

Using pkg-config

pkg-config --cflags --libs cuds

Include headers

#include <cuds/cuds.h>

Example projects demonstrating how to use CUDS are available in the sample/ directory.


Tests

List all available test presets :

ctest --list-presets

Build and run all tests, using a preset :

ctest --preset linux-gcc-debug

Build and run a specific test executable :

ctest --preset linux-gcc-debug -R test_version

Clean

Remove build artifacts :

rm -rf build

Or clean a specific build directory :

cmake --build build/linux-gcc-release --target clean

Authors

Raphael CAUSSE (raphael.causse2@gmail.com)

About

C Utilities and Data Structures library.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors