Skip to content

Commit 59d90d1

Browse files
(#9310) add fusepp by jachappell/Fusepp
* 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 <[email protected]> * use cmake install Co-authored-by: Uilian Ries <[email protected]> * Update recipes/fusepp/all/conanfile.py Co-authored-by: Uilian Ries <[email protected]> * Update recipes/fusepp/all/conanfile.py Co-authored-by: Uilian Ries <[email protected]> * Update recipes/fusepp/all/conanfile.py Co-authored-by: Uilian Ries <[email protected]> * fusepp: fix syntax and add install files via cmake * fusepp: simplify test package * fusepp: add suggested changes Co-authored-by: Uilian Ries <[email protected]>
1 parent de5ff30 commit 59d90d1

File tree

7 files changed

+139
-0
lines changed

7 files changed

+139
-0
lines changed

recipes/fusepp/all/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
cmake_minimum_required(VERSION 3.4)
2+
project(cmake_wrapper)
3+
4+
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
5+
conan_basic_setup(KEEP_RPATHS)
6+
7+
set(SOURCE_SUBFOLDER ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder)
8+
9+
file(GLOB_RECURSE INCLUDE_FILES "${SOURCE_SUBFOLDER}/Fuse*.h" "${SOURCE_SUBFOLDER}/Fuse.cpp")
10+
11+
add_library(fusepp ${SOURCE_SUBFOLDER}/Fuse.cpp)
12+
13+
set_target_properties(fusepp PROPERTIES PUBLIC_HEADER "${INCLUDE_FILES}")
14+
install(TARGETS fusepp
15+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
16+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
17+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
18+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

recipes/fusepp/all/conandata.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sources:
2+
"cci.20210820":
3+
url: "https://github.com/jachappell/Fusepp/archive/4a457accb1ae4686b0ccc2805a317bc29a5cddf8.zip"
4+
sha256: "2ea6379f0d76b9a8e7e805d7c6941863a7254653633e2f63a551c2ef6c4605e8"

recipes/fusepp/all/conanfile.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
from conans import ConanFile, CMake, tools
2+
from conans.errors import ConanInvalidConfiguration
3+
4+
5+
class FuseppConan(ConanFile):
6+
name = "fusepp"
7+
description = "A simple C++ wrapper for the FUSE filesystem."
8+
license = "MIT"
9+
topics = ("fuse", "fusepp", "wrapper", "filesystem")
10+
homepage = "https://github.com/jachappell/Fusepp"
11+
url = "https://github.com/conan-io/conan-center-index"
12+
13+
settings = "os", "arch", "compiler", "build_type"
14+
options = {
15+
"shared": [True, False],
16+
"fPIC": [True, False],
17+
}
18+
default_options = {
19+
"shared": False,
20+
"fPIC": True
21+
}
22+
exports_sources = "CMakeLists.txt"
23+
24+
generators = "cmake"
25+
_cmake = None
26+
27+
@property
28+
def _source_subfolder(self):
29+
return "source_subfolder"
30+
31+
def validate(self):
32+
if self.settings.compiler.get_safe("cppstd"):
33+
tools.check_min_cppstd(self, "11")
34+
if self.settings.compiler == "gcc":
35+
if tools.Version(self.settings.compiler.version) < "6":
36+
raise ConanInvalidConfiguration("gcc < 6 is unsupported")
37+
38+
def config_options(self):
39+
if self.settings.os == "Windows":
40+
del self.options.fPIC
41+
42+
def configure(self):
43+
if self.options.shared:
44+
del self.options.fPIC
45+
del self.settings.compiler.libcxx
46+
del self.settings.compiler.cppstd
47+
48+
def source(self):
49+
tools.get(**self.conan_data["sources"][self.version],
50+
strip_root=True, destination=self._source_subfolder)
51+
52+
def requirements(self):
53+
self.requires("libfuse/3.10.5")
54+
55+
def _configure_cmake(self):
56+
if self._cmake:
57+
return self._cmake
58+
self._cmake = CMake(self)
59+
self._cmake.configure()
60+
return self._cmake
61+
62+
def build(self):
63+
cmake = self._configure_cmake()
64+
cmake.build()
65+
66+
def package(self):
67+
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
68+
cmake = self._configure_cmake()
69+
cmake.install()
70+
71+
def package_info(self):
72+
self.cpp_info.libs = ["fusepp"]
73+
# TODO: Remove after Conan 2.0
74+
self.cpp_info.names["cmake_find_package"] = "fusepp"
75+
self.cpp_info.names["cmake_find_package_multi"] = "fusepp"
76+
77+
self.cpp_info.set_property("cmake_file_name", "fusepp")
78+
self.cpp_info.set_property("cmake_target_name", "fusepp")
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cmake_minimum_required(VERSION 3.1)
2+
project(test_package)
3+
4+
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
5+
conan_basic_setup(TARGETS)
6+
7+
find_package(fusepp CONFIG REQUIRED)
8+
9+
add_executable(${PROJECT_NAME} example.cpp)
10+
target_link_libraries(${PROJECT_NAME} fusepp::fusepp)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import os
2+
from conans import ConanFile, CMake, tools
3+
4+
5+
class TestPackageConan(ConanFile):
6+
settings = "os", "compiler", "build_type", "arch"
7+
generators = "cmake", "cmake_find_package_multi"
8+
9+
def build(self):
10+
cmake = CMake(self)
11+
cmake.configure()
12+
cmake.build()
13+
14+
def test(self):
15+
if not tools.cross_building(self):
16+
bin_path = os.path.join("bin", "test_package")
17+
self.run("%s --version" % bin_path, run_environment=True)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "Fuse.h"
2+
#include "Fuse-impl.h"
3+
4+
class MyFilesystem : public Fusepp::Fuse<MyFilesystem> {
5+
};
6+
7+
int main() {
8+
MyFilesystem();
9+
}

recipes/fusepp/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
versions:
2+
"cci.20210820":
3+
folder: all

0 commit comments

Comments
 (0)