forked from mchehab/zbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
43 lines (37 loc) · 1.32 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
from conans import ConanFile, CMake, tools
class ZBarConan(ConanFile):
name = 'zbar'
lib_version = '0.23.93'
revision = '0'
version = '{}-{}'.format(lib_version, revision)
settings = 'os', 'compiler', 'build_type', 'arch'
description = 'ZBar QR Code Reader'
url = '[email protected]:Pix4D/ZBar.git'
license = 'LGPL'
generators = 'cmake'
exports_sources = [
'zbar/*',
'include/*',
'cmake/*',
'CMakeLists.txt',
]
options = {
'shared' : [True, False],
}
default_options = 'shared=True'
def requirements(self):
if self.settings.os == 'Windows':
self.requires('libiconv/1.15.0-0@pix4d/stable')
def build(self):
cmake = CMake(self, parallel=True)
cmake.definitions['BUILD_SHARED_LIBS'] = self.options.shared
cmake.configure()
cmake.build(target='install')
def package_info(self):
self.cpp_info.includedirs = ['include'] # Ordered list of include paths
self.cpp_info.libdirs = ['lib'] # Directories where libs are located
self.cpp_info.libs = ['zbar']
def package_id(self):
# Make all options and dependencies (direct and transitive) contribute
# to the package id
self.info.requires.full_package_mode()