-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
51 lines (44 loc) · 2.03 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
from conans.tools import download, unzip
import os
class Project(ConanFile):
name = "Gemini"
description = "Conan package for Gemini."
version = "1.0.0"
url = "PROJECT_URL_HERE"
settings = "arch", "build_type", "compiler", "os"
generators = "cmake"
options = {"shared": [True, False]}
default_options = "shared=True"
def imports(self):
self.copy("*.dylib*", dst="", src="lib")
self.copy("*.dll" , dst="", src="bin")
def source(self):
zip_name = "%s.zip" % self.version
download ("%s/archive/%s" % (self.url, zip_name), zip_name, verify=False)
unzip (zip_name)
os.unlink(zip_name)
def requirements(self):
""" List all required conan packages here. """
self.requires("gtest/1.11.0")
self.requires("eigen/3.4.0")
pass
def build(self):
cmake = CMake(self)
shared_options = "-DBUILD_SHARED_LIBS=ON" if self.options.shared else "-DBUILD_SHARED_LIBS=OFF"
self.run("cmake %s-%s %s %s" % (self.name, self.version, cmake.command_line, shared_options))
self.run("cmake --build . %s" % cmake.build_config)
def package(self):
include_folder = "%s-%s/include" % (self.name, self.version)
self.copy("*.h" , dst="include", src=include_folder)
self.copy("*.hpp" , dst="include", src=include_folder)
self.copy("*.inl" , dst="include", src=include_folder)
self.copy("*.dylib*", dst="lib" , keep_path=False )
self.copy("*.lib" , dst="lib" , keep_path=False )
self.copy("*.so*" , dst="lib" , keep_path=False )
self.copy("*.dll" , dst="bin" , keep_path=False )
def package_info(self):
self.cpp_info.libs = [self.name]
if self.settings.os == "Windows":
if not self.options.shared:
self.cpp_info.defines.append("%s_STATIC" % self.name.upper())