This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconanfile.py
51 lines (44 loc) · 1.92 KB
/
conanfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from conans import ConanFile, CMake, tools
import os
class LibqrencodeConan(ConanFile):
name = "libqrencode"
version = "4.0.0"
url = "https://github.com/bincrafters/conan-libqrencode"
homepage = "https://github.com/fukuchi/libqrencode"
description = "A fast and compact QR Code encoding library"
topics = ("conan", "libqrencode")
license = ("LGPL-2.1, LGPL-3.0")
exports = ["LICENSE.md"]
exports_sources = ["CMakeLists.txt", "sources.patch"]
generators = "cmake"
settings = "os", "arch", "compiler", "build_type"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {'shared': False, 'fPIC': True}
requires = (
"libiconv/1.15",
"libpng/1.6.37"
)
def config_options(self):
if self.settings.os == 'Windows':
del self.options.fPIC
def source(self):
tools.get("{0}/archive/v{1}.tar.gz".format(self.homepage, self.version))
extracted_dir = self.name + "-" + self.version
tools.patch(base_path=extracted_dir, patch_file="sources.patch")
#Rename to "sources" is a convention to simplify later steps
os.rename(extracted_dir, "sources")
def build(self):
cmake = CMake(self)
cmake.definitions["WITH_TOOLS"] = False
cmake.definitions["WITH_TESTS"] = False
cmake.configure()
cmake.build()
def package(self):
self.copy(pattern="qrencode.h", dst="include", src="sources", keep_path=False)
self.copy(pattern="*.dll", dst="bin", src="bin", keep_path=False)
self.copy(pattern="*.lib", dst="lib", src="lib", keep_path=False)
self.copy(pattern="*.a", dst="lib", src="lib", keep_path=False)
self.copy(pattern="*.so*", dst="lib", src="lib", keep_path=False)
self.copy(pattern="*.dylib", dst="lib", src="lib", keep_path=False)
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)