-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
61 lines (49 loc) · 1.88 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
import os
from conans import ConanFile, CMake, tools
required_conan_version = ">=1.30.0"
class HimalayaConan(ConanFile):
name = "Himalaya"
license = "GPL-3.0-only"
homepage = "https://github.com/Himalaya-Library/Himalaya"
description = "C++ library to calculate three-loop corrections to the Higgs boson mass in the MSSM"
topics = ("HEP")
settings = "os", "compiler", "build_type", "arch"
options = {"fPIC": [True, False]}
default_options = {"fPIC": True}
exports_sources = ["CMakeLists.txt"]
generators = "cmake"
_cmake = None
@property
def _source_subfolder(self):
return "source_subfolder"
@property
def _build_subfolder(self):
return "build_subfolder"
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
def requirements(self):
self.requires("eigen/[>=3.1]")
def source(self):
tools.get(**self.conan_data["sources"][self.version])
os.rename("Himalaya-{}".format(self.version), self._source_subfolder)
def build(self):
cmake = self._configure_cmake()
cmake.build()
def _configure_cmake(self):
if self._cmake:
return self._cmake
self._cmake = CMake(self)
self._cmake.configure(build_folder=self._build_subfolder)
return self._cmake
def package(self):
self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
cmake = self._configure_cmake()
cmake.install()
tools.rmdir(os.path.join(self.package_folder, "share"))
def package_info(self):
self.cpp_info.names["cmake_find_package"] = "Himalaya"
self.cpp_info.names["cmake_find_package_multi"] = "Himalaya"
self.cpp_info.names["pkg_config"] = "himalaya"
self.cpp_info.libs = ["Himalaya", "DSZ"]
self.cpp_info.requires = ["eigen::eigen"]