Skip to content

Commit

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

* First compiling version

* Cleanup hunter.cmake

* Fix findings

* Add pull request id
  • Loading branch information
Bjoe authored and bkotzz committed Dec 9, 2019
1 parent f038d1a commit b9dddc0
Show file tree
Hide file tree
Showing 5 changed files with 88 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 @@ -207,6 +207,7 @@ hunter_default_version(convertutf VERSION 1.0.1)
hunter_default_version(corrade VERSION 2019.01)
hunter_default_version(cpp_redis VERSION 3.5.0-h1)
hunter_default_version(cppcodec VERSION 0.2-p0)
hunter_default_version(cppfs VERSION 1.3.0)
hunter_default_version(cpr VERSION 1.3.0)
hunter_default_version(cpuinfo VERSION 0.0.0-d5e37ad-p0)
hunter_default_version(crashpad VERSION v0.0.1-p0)
Expand Down
31 changes: 31 additions & 0 deletions cmake/projects/cppfs/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# !!! DO NOT PLACE HEADER GUARDS HERE !!!

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

hunter_add_version(
PACKAGE_NAME
cppfs
VERSION
1.3.0
URL
"https://github.com/cginternals/cppfs/archive/v1.3.0.zip"
SHA1
b7ac401ba784c691546cd087a76701c39ed8f418
)

hunter_cmake_args(
cppfs
CMAKE_ARGS
OPTION_BUILD_TESTS=OFF
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(cppfs)
hunter_download(
PACKAGE_NAME cppfs
PACKAGE_INTERNAL_DEPS_ID "1"
)
20 changes: 20 additions & 0 deletions docs/packages/pkg/cppfs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. spelling::

cppfs

.. index::
single: unsorted ; cppfs

.. _pkg.cppfs:

cppfs
=====

- `Official <https://github.com/cginternals/cppfs>`__
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/cppfs/CMakeLists.txt>`__
- Added by `Joerg-Christian Boehme <https://github.com/Bjoe>`__ (`pr-92 <https://github.com/cpp-pm/hunter/pull/92>`__)

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

cmake_minimum_required(VERSION 3.2)

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

project(cppfs)

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

add_executable(boo boo.cpp)
target_link_libraries(boo PRIVATE cppfs::cppfs)
# DOCUMENTATION_END }
18 changes: 18 additions & 0 deletions examples/cppfs/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <iostream>
#include <cppfs/fs.h>
#include <cppfs/FileHandle.h>

using namespace cppfs;

int main() {
FileHandle fh = fs::open("testfile");

if (fh.isFile())
{
auto in = fh.createInputStream();
// ...

auto out = fh.createOutputStream();
// ...
}
}

0 comments on commit b9dddc0

Please sign in to comment.