-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconanfile.py
More file actions
43 lines (37 loc) · 1.37 KB
/
conanfile.py
File metadata and controls
43 lines (37 loc) · 1.37 KB
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
import os
class ImgppConan(ConanFile):
name = "imgpp"
version = "2.1.9"
license = "MIT"
author = "Fangyang Shen dev@shenfy.com"
url = "https://github.com/shenfy/imgpp"
description = "Basic C++ Image Wrapper"
topics = ("Computer Graphics", "Computer Vision", "Image Processing")
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [False], "no_ext_libs": [True, False]}
default_options = {"shared": False, "no_ext_libs": False}
generators = "cmake"
exports_sources = "src/*"
def build(self):
cmake = self._configure()
cmake.build()
def _configure(self):
cmake = CMake(self)
if self.options.no_ext_libs:
cmake.definitions["IMGPP_NO_EXT_LIBS"] = True
if self.settings.os == 'Android':
if 'NDK' in os.environ:
cmake.definitions['CMAKE_TOOLCHAIN_FILE'] = os.environ['NDK']
cmake.definitions['ANDROID_STL'] = 'c++_static'
cmake.configure(source_folder="src")
return cmake
def package(self):
cmake = self._configure()
cmake.install()
def package_info(self):
self.cpp_info.libs = ["imgpp"]
def requirements(self):
if not self.options.no_ext_libs:
self.requires("libjpeg-turbo/2.0.2")
self.requires("libpng/1.6.37")