-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
92 lines (78 loc) · 4.15 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
from conans import ConanFile, CMake, tools
import shutil
import os
class XmpsdkConan(ConanFile):
name = "XmpSdk"
version = "2016.7"
license = "The BSD License"
url = "https://github.com/piponazo/conan-xmpsdk"
description = "<Description of Xmpsdk here>"
settings = "os", "compiler", "build_type", "arch"
exports = ["CMake/*", "third-party/*", "FindXmpSdk.cmake", "MD5.patch"]
generators = "cmake"
short_paths = True
def system_requirements(self):
if tools.os_info.is_linux:
installer = tools.SystemPackageTool()
if tools.os_info.linux_distro == "ubuntu":
installer.install('uuid-dev')
elif tools.os_info.linux_distro == "fedora" or tools.os_info.linux_distro == "centos":
installer.install('uuid-devel')
def configure(self):
del self.settings.compiler.libcxx
def source(self):
tools.get('http://download.macromedia.com/pub/developer/xmp/sdk/XMP-Toolkit-SDK-CC201607.zip')
def build(self):
shutil.copyfile(src="CMake/CMakeLists.txt", dst="XMP-Toolkit-SDK-CC201607/CMakeLists.txt")
shutil.copyfile(src="CMake/XMPCore/CMakeLists.txt", dst="XMP-Toolkit-SDK-CC201607/XMPCore/CMakeLists.txt")
shutil.copytree(src="CMake/cmake", dst="XMP-Toolkit-SDK-CC201607/cmake")
shutil.rmtree("XMP-Toolkit-SDK-CC201607/third-party/expat")
shutil.copytree(src="third-party/expat", dst="XMP-Toolkit-SDK-CC201607/third-party/expat")
# It has been always compiled as a STATIC library within the Exiv2 project.
# In SHARED mode it has problems on windows, since they are not exporting some symbols
# properly.
cmake_args = {"BUILD_SHARED_LIBS": "OFF",
"CMAKE_BUILD_TYPE": "Release",
}
generator_arg = None
if tools.os_info.is_macos:
cmake_args.update({"XMP_OSX_SDK": os.environ["XMP_OSX_SDK"],
"CMAKE_XCODE_ATTRIBUTE_GCC_VERSION": "com.apple.compilers.llvm.clang.1_0"
})
generator_arg = 'Xcode'
cmake = CMake(self, generator=generator_arg)
cmake.verbose = True
cmake.configure(source_folder="XMP-Toolkit-SDK-CC201607", defs=cmake_args)
cmake.build()
tools.patch(base_path="XMP-Toolkit-SDK-CC201607/third-party/zuid/interfaces",
patch_file="MD5.patch")
def package(self):
self.copy("FindXmpSdk.cmake")
self.copy("*", dst="include", src="XMP-Toolkit-SDK-CC201607/public/include")
self.copy("*.h", dst="include", src="XMP-Toolkit-SDK-CC201607/third-party/zuid/interfaces")
self.copy("*.lib", dst="lib", keep_path=False,
excludes="XMP-Toolkit-SDK-CC201607/XMPFilesPlugins/*")
self.copy("*.dll", dst="bin", keep_path=False,
excludes="XMP-Toolkit-SDK-CC201607/XMPFilesPlugins/*")
self.copy("*.so", dst="lib", keep_path=False,
excludes="XMP-Toolkit-SDK-CC201607/XMPFilesPlugins/*")
self.copy("*.dylib", dst="lib", keep_path=False,
excludes="XMP-Toolkit-SDK-CC201607/XMPFilesPlugins/*")
self.copy("*.a", src="lib", dst="lib", keep_path=False,
excludes="XMP-Toolkit-SDK-CC201607/XMPFilesPlugins/*")
def package_info(self):
self.cpp_info.libs = ["XMPCore"]
self.cpp_info.includedirs = ['include'] # Ordered list of include paths
self.cpp_info.libdirs = ['lib'] # Directories where libraries can be found
self.cpp_info.resdirs = ['res'] # Directories where resources, data, etc can be found
self.cpp_info.bindirs = ['bin'] # Directories where executables and shared libs can be found
if tools.os_info.is_windows:
self.cpp_info.defines = ['WIN_ENV']
elif tools.os_info.is_macos:
self.cpp_info.defines = ['MAC_ENV']
else:
self.cpp_info.defines = ['UNIX_ENV']
self.cpp_info.cflags = [] # pure C flags
self.cpp_info.cppflags = [] # C++ compilation flags
self.cpp_info.sharedlinkflags = [] # linker flags
self.cpp_info.exelinkflags = [] # linker flags