{"id":19075352,"url":"https://github.com/gershnik/libuuid-cmake","last_synced_at":"2026-02-05T04:34:15.325Z","repository":{"id":143477862,"uuid":"502840102","full_name":"gershnik/libuuid-cmake","owner":"gershnik","description":"CMake build for libuuid library from unix-utils","archived":false,"fork":false,"pushed_at":"2025-12-19T04:55:33.000Z","size":52,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-22T01:30:55.342Z","etag":null,"topics":["cmake","libuuid"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gershnik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-06-13T06:54:19.000Z","updated_at":"2025-12-19T04:53:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"c470fd34-b82e-448e-86b1-b00fe198a5ae","html_url":"https://github.com/gershnik/libuuid-cmake","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/gershnik/libuuid-cmake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gershnik%2Flibuuid-cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gershnik%2Flibuuid-cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gershnik%2Flibuuid-cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gershnik%2Flibuuid-cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gershnik","download_url":"https://codeload.github.com/gershnik/libuuid-cmake/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gershnik%2Flibuuid-cmake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29111950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T03:44:17.043Z","status":"ssl_error","status_checked_at":"2026-02-05T03:44:12.077Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","libuuid"],"created_at":"2024-11-09T01:54:27.770Z","updated_at":"2026-02-05T04:34:15.310Z","avatar_url":"https://github.com/gershnik.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libuuid-cmake\n\n[![Language](https://img.shields.io/badge/language-CMake-blue.svg)](https://cmake.org)\n[![Version](https://img.shields.io/badge/CMake-21-blue.svg)](https://cmake.org/cmake/help/latest/release/3.21.html)\n[![License](https://img.shields.io/badge/license-BSD-brightgreen.svg)](https://opensource.org/licenses/BSD-3-Clause)\n[![Tests](https://github.com/gershnik/libuuid-cmake/actions/workflows/test.yml/badge.svg)](https://github.com/gershnik/libuuid-cmake/actions/workflows/test.yml)\n\nCMake build for [libuuid](https://github.com/util-linux/util-linux/tree/master/libuuid) library from [util-linux](https://github.com/util-linux/util-linux)\n\nLibuuid is a portable, [BSD licensed](https://github.com/util-linux/util-linux/blob/master/libuuid/COPYING), \nlibrary that is part of util-linux bundle. The whole bundle comes with autoconf and meson build scripts which, \nwhile not terribly complicated to use, aren't very friendly to CMake projects. The libuuid library is also available \nvia package managers on all Linux platforms, Conan and possibly other places, but these, again, introduce friction \ninto a simple CMake workflow.\n\nThis project allows you to use libuuid directly from CMake with no extra steps or complications. \n\n## Requirements\n\n* CMake 3.21 or newer\n* Internet connection when _configuring_ CMake. Note that this project automatically fetches libuuid sources from github.\n\n## Versioning\n\nThe tags in this repository have the following form:\n\n```\nutil-linux-tag[.revN]\n```\n\nWhere `util-linux-tag` is the release tag in [util-linux](https://github.com/util-linux/util-linux) such as `v2.39`, \n`v2.39.1` etc.\nThe optional revision field is used when there are changes/bug fixes etc. in *this repository*. The numeric value\n`N` is incremented by 1 every time a new revision is released.\nThus, `v2.39.rev1` is a newer revision than `v2.39` and both include `libuuid` version `v2.39`\n\n\n## Usage\n\n### Dependency with FetchContent\n\n```cmake\ninclude(FetchContent)\n...\nFetchContent_Declare(libuuid\n    GIT_REPOSITORY  https://github.com/gershnik/libuuid-cmake.git\n    GIT_TAG         v2.39.1\n    GIT_SHALLOW     TRUE\n)\n...\nFetchContent_MakeAvailable(libuuid)\n...\ntarget_link_libraries(mytarget\nPRIVATE\n  uuid::uuid\n)\n```\n\u003e ℹ\u0026#xFE0F; _[What is FetchContent?](https://cmake.org/cmake/help/latest/module/FetchContent.html)_\n\n### Dependency in a subdirectory\n\n1. Download or clone this repository into SOME_PATH\n2. Add it as subdirectory \n```cmake\n\nadd_subdirectory(SOME_PATH)\n...\ntarget_link_libraries(mytarget\nPRIVATE\n  uuid::uuid\n)\n```\n\nRegardless of which method you use the `uuid.h` header will be available via\n```c\n#include \u003cuuid/uuid.h\u003e\n```\n\n### Building and installing on your system\n\nYou can also build and install libuuid on your system using CMake (this is only useful on non-Linux platforms,\nsince on Linux you might as well just use original util-linux build).\nNote that man pages will only be generated if you have [Asciidoctor](https://asciidoctor.org) available.\n\n1. Download or clone this repository into SOME_PATH\n2. Do something like this on command line\n```bash\ncd SOME_PATH\ncmake -S . -B build \ncmake --build build\n\n#Optional\n#cmake --build build --target run-tests\n\nsudo cmake --install build\n#or for custom prefix\ncmake --install build --prefix some-dir\n```\n\nThe installation above sets things up so that you can do `find_package(uuid)` from CMake as well as use\n`pkg-config --libs --cflags uuid` if you have `pkg-config` available. \n\nNote that by default `cmake` installs under `/usr/local` which might not be in the list of places your\n`pkg-config` looks into. If so you might need to do:\n```bash\nexport PKG_CONFIG_PATH=/usr/local/share/pkgconfig\n```\n\n## Settings and targets\n\n### Choosing static or shared libraries \nThere are 3 variables that affect the type of library built:\n\n* `LIBUUID_SHARED` - if set enables shared library target even if it otherwise wouldn't be enabled\n* `LIBUUID_STATIC` - if set enables static library target even if it otherwise wouldn't be enabled\n* [BUILD_SHARED_LIBS](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html) - see below\n\nIf you don't explicitly set either `LIBUUID_SHARED` or `LIBUUID_STATIC` the behavior is as follows:\n\n* If the libuuid project is not a top level project then the enabled variant depends on `BUILD_SHARED_LIBS`.\n  If `BUILD_SHARED_LIBS` is `ON` then the shared library target will be enabled. Otherwise - the static one.\n* If the libuuid project is a top level project then both variants are enabled.\n\nYou can [set()](https://cmake.org/cmake/help/latest/command/set.html) `LIBUUID_SHARED`, `LIBUUID_STATIC` and `BUILD_SHARED_LIBS` in your CMake script prior to \nadding libuuid or specify them on CMake command line.\n\nThe exposed targets can be:\n\n* `uuid::uuid_static` - the static library\n* `uuid::uuid_shared` - the shared library\n* `uuid::uuid` - the \"default\" one. If only one of static/shared variants is enabled, this one points to it. \n  If both variants are enabled then this alias points to `uuid::uuid_shared` if `BUILD_SHARED_LIBS` is `ON` or \n  `uuid::uuid_static` otherwise.  \n\n### libuuid configuration\n\nTwo additional CMake settings expose functionality originally available via configure flags of `util-linux` autoconf build. \nThese are:\n\n* `LIBUUID_RUNSTATEDIR` for `--runstatedir`. Default is `/run`\n* `LIBUUID_LOCALSTATEDIR` for `--localstatedir`. Default is `/var`\n\nThe precise effects of each original flag on libuuid are poorly documented. From source code examination `localstatedir`\ncan be used as a root directory for storage of local clock state, and `runstatedir` as a root for a location for Unix domain\nsockets to communicate with `uuidd` daemon. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgershnik%2Flibuuid-cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgershnik%2Flibuuid-cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgershnik%2Flibuuid-cmake/lists"}