Skip to content

Commit

Permalink
[#2] Add conan recipe (#12)
Browse files Browse the repository at this point in the history
* add conanfile.py

* update CHANGELOG
  • Loading branch information
atimin authored Mar 9, 2022
1 parent a142051 commit 562ee6a
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**Features**:

* Support Reduct Storage API v0.2.0, [PR-9](https://github.com/reduct-storage/reduct-cpp/pull/9)
* Add conan recipe, [PR-12](https://github.com/reduct-storage/reduct-cpp/pull/12)

**Documentation**:

Expand Down
2 changes: 1 addition & 1 deletion cmake/InstallDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include(${CMAKE_BINARY_DIR}/conan.cmake)
find_program(CONAN_CMD conan)
if (CONAN_CMD)
conan_cmake_autodetect(settings)
conan_cmake_install(PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR}/conanfile.txt
conan_cmake_install(PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR}/conanfile.py
BUILD missing
SETTINGS ${settings})

Expand Down
45 changes: 45 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import re

from conans import ConanFile, CMake


class DriftFrameworkConan(ConanFile):
name = "reduct-cpp"
version = "0.1.0"
license = "MIT"
author = "Alexey Timin"
url = "https://github.com/reduct-storage/reduct-cpp"
description = "Reduct Storage Client SDK for C++"
topics = ("reduct-storage", "http-client", "http-api")
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}
generators = "cmake"

requires = ("fmt/8.1.1",
"cpp-httplib/0.10.1",
"nlohmann_json/3.10.5",
"catch2/2.13.8")

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

def source(self):
self.run(f'git clone --branch v{self.version} https://github.com/reduct-storage/reduct-cpp.git')

def build(self):
cmake = CMake(self)
cmake.configure(source_dir='reduct-cpp')
cmake.build()

def package(self):
self.copy("*.h", dst="include/reduct", src=f"{self.source_folder}/reduct-cpp/src/reduct")
self.copy("*reductcpp.lib", dst="lib", keep_path=False)
self.copy("*.dll", dst="bin", keep_path=False)
self.copy("*.so", dst="lib", keep_path=False)
self.copy("*.dylib", dst="lib", keep_path=False)
self.copy("*.a", dst="lib", keep_path=False)

def package_info(self):
self.cpp_info.libs = ["reductcpp"]
8 changes: 0 additions & 8 deletions conanfile.txt

This file was deleted.

0 comments on commit 562ee6a

Please sign in to comment.