Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'uuid' package #193

Merged
merged 4 commits into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ hunter_default_version(type_safe VERSION 0.2.1-p2)
hunter_default_version(units VERSION 2.3.1)
hunter_default_version(utf8 VERSION 2.3.4-p1)
hunter_default_version(util_linux VERSION 2.30.1)
hunter_default_version(uuid VERSION 1.0.3)
hunter_default_version(v8 VERSION 7.4.98-p3)
hunter_default_version(vectorial VERSION 0.0.0-ae7dc88-p0)
hunter_default_version(vorbis VERSION 1.3.6-p1)
Expand Down
36 changes: 36 additions & 0 deletions cmake/projects/uuid/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# !!! DO NOT PLACE HEADER GUARDS HERE !!!

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_cmake_args)
include(hunter_configuration_types)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
PACKAGE_NAME
uuid
VERSION
1.0.3
URL
"https://sourceforge.net/projects/libuuid/files/libuuid-1.0.3.tar.gz/download"
SHA1
46eaedb875ae6e63677b51ec583656199241d597
)

hunter_cmake_args(
uuid
CMAKE_ARGS
PKGCONFIG_EXPORT_TARGETS=uuid
)

hunter_configuration_types(uuid CONFIGURATION_TYPES Release)
hunter_pick_scheme(DEFAULT url_sha1_autotools)
hunter_cacheable(uuid)
hunter_download(
PACKAGE_NAME uuid
PACKAGE_INTERNAL_DEPS_ID "1"
PACKAGE_UNRELOCATABLE_TEXT_FILES
"lib/libuuid.la"
"lib/pkgconfig/uuid.pc"
)
20 changes: 20 additions & 0 deletions docs/packages/pkg/uuid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. spelling::

uuid

.. index::
single: unsorted ; uuid

.. _pkg.uuid:

uuid
====

- `Official <https://sourceforge.net/projects/libuuid/>`__
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/uuid/CMakeLists.txt>`__
- Added by `Joerg-Christian Boehme <https://github.com/Bjoe>`__ (`pr-193 <https://github.com/cpp-pm/hunter/pull/193>`__)

.. literalinclude:: /../examples/uuid/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
18 changes: 18 additions & 0 deletions examples/uuid/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c)
# All rights reserved.

cmake_minimum_required(VERSION 3.2)

# Emulate HunterGate:
# * https://github.com/cpp-pm/gate
include("../common.cmake")

project(uuid)

# DOCUMENTATION_START {
hunter_add_package(uuid)
find_package(uuid CONFIG REQUIRED)

add_executable(boo boo.cpp)
target_link_libraries(boo PUBLIC PkgConfig::uuid)
# DOCUMENTATION_END }
11 changes: 11 additions & 0 deletions examples/uuid/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <uuid.h>
#include <iostream>

int main() {
char sguid[37];
uuid_t uuid = {0};
uuid_generate(uuid);
uuid_unparse(uuid, sguid);
std::cout << sguid << std::endl;
return 0;
}