CUDS is a C library providing generic data structures, common utilities, and helper modules.
- C99-compatible compiler (GCC, Clang, or MSVC)
- CMake >= 3.16
- Ninja (recommended)
List all available configure presets:
cmake --list-presetsConfigure the project, using a preset (recommended) :
cmake --preset linux-gcc-releaseIf 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=OFFNotes:
- Both static and shared libraries are built by default. Enable/Disable by setting options
CUDS_BUILD_SHAREDandCUDS_BUILD_STATICat configuration. - Tests are built by default. Enable/Disable by setting option
CUDS_BUILD_TESTSat configuration.
List all available build presets:
cmake --build --list-presetsBuild the project, using a preset (recommended) :
cmake --build --preset linux-gcc-releaseIf you prefer to build manually, in <BUILD_DIR> :
cmake --build <BUILD_DIR>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
# 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)pkg-config --cflags --libs cuds#include <cuds/cuds.h>Example projects demonstrating how to use CUDS are available in the sample/ directory.
List all available test presets :
ctest --list-presetsBuild and run all tests, using a preset :
ctest --preset linux-gcc-debugBuild and run a specific test executable :
ctest --preset linux-gcc-debug -R test_versionRemove build artifacts :
rm -rf buildOr clean a specific build directory :
cmake --build build/linux-gcc-release --target cleanRaphael CAUSSE (raphael.causse2@gmail.com)