forked from bilke/conan-tiff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
45 lines (40 loc) · 1.62 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
import os
from conans import ConanFile, CMake
from conans.tools import download, unzip
class LibtiffConan(ConanFile):
name = "libtiff"
description = """Library for Tag Image File Format (TIFF), a widely used
format for storing image data"""
version = "4.0.6"
generators = "cmake"
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False]}
default_options = "shared=False"
requires = "zlib/1.2.11@conan/stable"
exports = ["CMakeLists.txt", "FindTIFF.cmake"]
url="http://github.com/bilke/conan-tiff"
license="http://www.remotesensing.org/libtiff/"
def config(self):
del self.settings.compiler.libcxx
def source(self):
zip_name = "tiff-%s.zip" % self.version
download("http://opengeosys.s3.amazonaws.com/ogs6-lib-sources/%s" % zip_name , zip_name)
unzip(zip_name)
os.unlink(zip_name)
def build(self):
cmake = CMake(self)
cmake.definitions["lzma"] = "OFF"
cmake.definitions["jpeg"] = "OFF"
if self.settings.os == "Linux":
cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = "ON"
if self.options.shared == False:
cmake.definitions["BUILD_SHARED_LIBS"] = "OFF"
else:
cmake.definitions["BUILD_SHARED_LIBS"] = "ON"
cmake.configure(build_dir="build")
cmake.build(target="install")
def package_info(self):
if self.settings.os == "Windows" and self.settings.build_type == "Debug":
self.cpp_info.libs = ["tiffd", "tiffxxd"]
else:
self.cpp_info.libs = ["tiff", "tiffxx"]