This repository has been archived by the owner on Feb 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconanfile.py
46 lines (39 loc) · 1.59 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from conans import ConanFile, CMake, tools
class CerealConan(ConanFile):
name = "cereal"
version = "1.2.2"
description = "Serialization header-only library for C++11."
url = "https://github.com/conan-community/conan-cereal"
homepage = "https://github.com/USCiLab/cereal"
author = "Conan Community <[email protected]>"
topics = ("conan", "cereal", "header-only", "serialization", "cpp11")
license = "BSD-3"
options = {"thread_safe": [True, False]}
default_options = {"thread_safe": False}
exports = "LICENSE"
exports_sources = "CMakeLists.txt"
generators = "cmake"
no_copy_source = True
_source_subfolder = "source_subfolder"
def configure(self):
self.output.warn("[DEPRECATED] Package cereal/1.2.2@conan/stable is being deprecated. Change yours to require cereal/1.2.2 instead")
def source(self):
source_url = ("%s/archive/v%s.zip" % (self.homepage, self.version))
tools.get(source_url)
os.rename("%s-%s" % (self.name, self.version, ), self._source_subfolder)
def package(self):
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
cmake = CMake(self)
cmake.definitions["JUST_INSTALL_CEREAL"] = True
cmake.configure()
cmake.install()
def package_id(self):
self.info.header_only()
def package_info(self):
if self.options.thread_safe:
self.cpp_info.defines = ["CEREAL_THREAD_SAFE=1"]
if tools.os_info.is_linux:
self.cpp_info.libs.append("pthread")