Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1924 from tastytea/pr.libxdg-basedir
Browse files Browse the repository at this point in the history
Add 'libxdg-basedir' package
  • Loading branch information
ruslo authored Jul 31, 2019
2 parents 11df493 + 52f1320 commit 2953902
Show file tree
Hide file tree
Showing 5 changed files with 70 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 @@ -329,6 +329,7 @@ hunter_default_version(libsodium VERSION 1.0.16-p0)
hunter_default_version(libunibreak VERSION 4.0)
hunter_default_version(libusb VERSION 1.0.22)
hunter_default_version(libuv VERSION 1.24.0-p1)
hunter_default_version(libxdg-basedir VERSION 1.2.0)
hunter_default_version(libxml2 VERSION 2.9.7)
hunter_default_version(libyuv VERSION 1514-p3)
hunter_default_version(libzip VERSION 1.5.2-d68a667-p0)
Expand Down
27 changes: 27 additions & 0 deletions cmake/projects/libxdg-basedir/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
include(hunter_add_version)
include(hunter_configuration_types)
include(hunter_pick_scheme)
include(hunter_download)
include(hunter_cacheable)
include(hunter_cmake_args)

hunter_add_version(
PACKAGE_NAME libxdg-basedir
VERSION "1.2.0"
URL "https://github.com/devnev/libxdg-basedir/archive/libxdg-basedir-1.2.0.tar.gz"
SHA1 e671b01b17c8cf785d95dd3aefa93e7cf31e56a5
)

hunter_configuration_types(libxdg-basedir CONFIGURATION_TYPES Release)
hunter_pick_scheme(DEFAULT url_sha1_autogen_autotools)
hunter_cacheable(libxdg-basedir)

hunter_cmake_args(
libxdg-basedir
CMAKE_ARGS
PKGCONFIG_EXPORT_TARGETS=libxdg-basedir
)

hunter_download(PACKAGE_NAME libxdg-basedir
PACKAGE_INTERNAL_DEPS_ID "1" # Increment for each new pull request
PACKAGE_UNRELOCATABLE_TEXT_FILES lib/pkgconfig/libxdg-basedir.pc)
21 changes: 21 additions & 0 deletions docs/packages/pkg/libxdg-basedir.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. spelling::

libxdg
basedir

.. index::
single: Filesystem ; libxdg-basedir

.. _pkg.libxdg-basedir:

libxdg-basedir
==============

- `Official <https://github.com/devnev/libxdg-basedir>`__
- `Example <https://github.com/ruslo/hunter/blob/master/examples/libxdg-basedir/CMakeLists.txt>`__
- Added by `tastytea <https://github.com/tastytea>`__ (`pr-1924 <https://github.com/ruslo/hunter/pull/1924>`__)

.. literalinclude:: /../examples/libxdg-basedir/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
13 changes: 13 additions & 0 deletions examples/libxdg-basedir/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.2)

include("../common.cmake")

project(download-libxdg-basedir)

# DOCUMENTATION_START {
hunter_add_package(libxdg-basedir)
find_package(libxdg-basedir CONFIG REQUIRED)

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

int main()
{
xdgHandle xdg;
xdgInitHandle(&xdg);
xdgWipeHandle(&xdg);
}

0 comments on commit 2953902

Please sign in to comment.