-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
56 lines (47 loc) · 1.67 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
from conans import ConanFile, CMake, tools
class ScLogger(ConanFile):
name = "sc_logger"
version = "1.0.4"
description = "Self check logger"
author = "BoykoSO <[email protected]>"
settings = "os", "compiler", "arch", "build_type"
generators = "cmake"
options = {
"shared": [True, False],
"fPIC": [True, False],
"build_testing": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"build_testing": False,
}
_source_subfolder = "source_subfolder"
def requirements(self):
if self.options.build_testing:
self.requires("gtest/1.8.1@bincrafters/stable")
def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["BUILD_TESTING"] = self.options.build_testing
cmake.configure(source_folder = self._source_subfolder)
return cmake
def source(self):
git = tools.Git(folder=self._source_subfolder)
git.clone("https://github.com/tomsksoft-llc/sc-logger")
git.checkout("v%s" % self.version);
def build(self):
cmake = self._configure_cmake()
cmake.build()
def package(self):
cmake = self._configure_cmake()
cmake.install()
def package2(self):
self.copy("*.h", dst="include", src="include")
self.copy("libsc_logger.a", dst="lib")
self.copy("libsc_logger.lib", dst="lib")
self.copy("libsc_logger.so", dst="lib")
self.copy("libsc_logger.dll", dst="lib")
def package_info(self):
self.cpp_info.libs = ["sc_logger"]
def imports(self):
self.copy("FindFilesystem.cmake", dst="cmake/modules", src="cmake/modules")