Skip to content

Commit

Permalink
Implement conan recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
amatosov-rbx committed Feb 11, 2019
1 parent 5acd377 commit 01a5e4b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from conan.packager import ConanMultiPackager

if __name__ == "__main__":
builder = ConanMultiPackager(build_policy="outdated")
builder.add_common_builds(shared_option_name=None)
builder.run()
7 changes: 7 additions & 0 deletions conan-wrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 2.8.12)
project(cmake_wrapper)

include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_subdirectory(".." "nanopb")
32 changes: 32 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from conans import ConanFile, CMake, tools
from os import path

class NanoPbConan(ConanFile):
name = "nanopb"
version = "0.3.9.2"
license = "zlib"
url = "https://jpa.kapsi.fi/nanopb/"
description = "Protocol Buffers with small code size"
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
exports = '*'
options = {
"fPIC": [True, False],
}
default_options = {
"fPIC": True,
}

def configure(self):
if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio":
del self.options.fPIC

def build(self):
cmake = CMake(self)
cmake.configure(source_folder=path.join(self.source_folder, "conan-wrapper"))
cmake.build()
cmake.install()

def package_info(self):
self.cpp_info.includedirs = ["include"]
self.cpp_info.libdirs = ["lib"]

0 comments on commit 01a5e4b

Please sign in to comment.