Skip to content

Commit

Permalink
Add 'uuid' package (#193)
Browse files Browse the repository at this point in the history
* Initial commit

* First working build.

* Add offical url

* Add PR number
  • Loading branch information
Bjoe committed May 11, 2020
1 parent e3e00a8 commit ab68c00
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 0 deletions.
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;
}

0 comments on commit ab68c00

Please sign in to comment.