Skip to content

Commit

Permalink
(#9310) add fusepp by jachappell/Fusepp
Browse files Browse the repository at this point in the history
* fusepp: initial commit

* fusepp: initial commit

* fusepp: require fuse

* fusepp: fix tag

* fusepp: fix typo

* fusepp: check min cppstd 11

* fusepp: mark gcc < 6 as unsupported

* fusepp: add missing import

* fusepp: upstream only

* Update recipes/fusepp/all/CMakeLists.txt

Co-authored-by: Uilian Ries <uilianries@gmail.com>

* use cmake install

Co-authored-by: Uilian Ries <uilianries@gmail.com>

* Update recipes/fusepp/all/conanfile.py

Co-authored-by: Uilian Ries <uilianries@gmail.com>

* Update recipes/fusepp/all/conanfile.py

Co-authored-by: Uilian Ries <uilianries@gmail.com>

* Update recipes/fusepp/all/conanfile.py

Co-authored-by: Uilian Ries <uilianries@gmail.com>

* fusepp: fix syntax and add install files via cmake

* fusepp: simplify test package

* fusepp: add suggested changes

Co-authored-by: Uilian Ries <uilianries@gmail.com>
  • Loading branch information
winternet and uilianries authored Mar 1, 2022
1 parent de5ff30 commit 59d90d1
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 0 deletions.
18 changes: 18 additions & 0 deletions recipes/fusepp/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.4)
project(cmake_wrapper)

include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup(KEEP_RPATHS)

set(SOURCE_SUBFOLDER ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder)

file(GLOB_RECURSE INCLUDE_FILES "${SOURCE_SUBFOLDER}/Fuse*.h" "${SOURCE_SUBFOLDER}/Fuse.cpp")

add_library(fusepp ${SOURCE_SUBFOLDER}/Fuse.cpp)

set_target_properties(fusepp PROPERTIES PUBLIC_HEADER "${INCLUDE_FILES}")
install(TARGETS fusepp
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
4 changes: 4 additions & 0 deletions recipes/fusepp/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"cci.20210820":
url: "https://github.com/jachappell/Fusepp/archive/4a457accb1ae4686b0ccc2805a317bc29a5cddf8.zip"
sha256: "2ea6379f0d76b9a8e7e805d7c6941863a7254653633e2f63a551c2ef6c4605e8"
78 changes: 78 additions & 0 deletions recipes/fusepp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration


class FuseppConan(ConanFile):
name = "fusepp"
description = "A simple C++ wrapper for the FUSE filesystem."
license = "MIT"
topics = ("fuse", "fusepp", "wrapper", "filesystem")
homepage = "https://github.com/jachappell/Fusepp"
url = "https://github.com/conan-io/conan-center-index"

settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
}
default_options = {
"shared": False,
"fPIC": True
}
exports_sources = "CMakeLists.txt"

generators = "cmake"
_cmake = None

@property
def _source_subfolder(self):
return "source_subfolder"

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, "11")
if self.settings.compiler == "gcc":
if tools.Version(self.settings.compiler.version) < "6":
raise ConanInvalidConfiguration("gcc < 6 is unsupported")

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
del self.options.fPIC
del self.settings.compiler.libcxx
del self.settings.compiler.cppstd

def source(self):
tools.get(**self.conan_data["sources"][self.version],
strip_root=True, destination=self._source_subfolder)

def requirements(self):
self.requires("libfuse/3.10.5")

def _configure_cmake(self):
if self._cmake:
return self._cmake
self._cmake = CMake(self)
self._cmake.configure()
return self._cmake

def build(self):
cmake = self._configure_cmake()
cmake.build()

def package(self):
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
cmake = self._configure_cmake()
cmake.install()

def package_info(self):
self.cpp_info.libs = ["fusepp"]
# TODO: Remove after Conan 2.0
self.cpp_info.names["cmake_find_package"] = "fusepp"
self.cpp_info.names["cmake_find_package_multi"] = "fusepp"

self.cpp_info.set_property("cmake_file_name", "fusepp")
self.cpp_info.set_property("cmake_target_name", "fusepp")
10 changes: 10 additions & 0 deletions recipes/fusepp/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.1)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(fusepp CONFIG REQUIRED)

add_executable(${PROJECT_NAME} example.cpp)
target_link_libraries(${PROJECT_NAME} fusepp::fusepp)
17 changes: 17 additions & 0 deletions recipes/fusepp/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os
from conans import ConanFile, CMake, tools


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run("%s --version" % bin_path, run_environment=True)
9 changes: 9 additions & 0 deletions recipes/fusepp/all/test_package/example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "Fuse.h"
#include "Fuse-impl.h"

class MyFilesystem : public Fusepp::Fuse<MyFilesystem> {
};

int main() {
MyFilesystem();
}
3 changes: 3 additions & 0 deletions recipes/fusepp/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"cci.20210820":
folder: all

0 comments on commit 59d90d1

Please sign in to comment.