-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#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 <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
1 parent
de5ff30
commit 59d90d1
Showing
7 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
"cci.20210820": | ||
folder: all |