-
Notifications
You must be signed in to change notification settings - Fork 7
/
conanfile.py
34 lines (29 loc) · 1.37 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
from conan import ConanFile
from conan.tools.files import copy
from conan.tools.files import rename
import os
class Bncsutil(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeDeps", "CMakeToolchain"
requires = (
"gmp/6.3.0",
)
def generate(self):
# Workaround for a conan bug producing wrongly named libraries..
if self.settings.os == "Windows":
gmp_libdir = self.dependencies["gmp"].cpp_info.libdir
gmp_from_name = f"{gmp_libdir}\libgmp.a"
gmp_to_name = f"{gmp_libdir}\gmp.lib"
gmpxx_from_name = f"{gmp_libdir}\libgmpxx.a"
gmpxx_to_name = f"{gmp_libdir}\gmpxx.lib"
if os.path.isfile(gmp_from_name):
print("Renaming " + gmp_from_name + " to " + gmp_to_name)
rename(self, gmp_from_name, gmp_to_name)
if os.path.isfile(gmpxx_from_name):
print("Renaming " + gmpxx_from_name + " to " + gmpxx_to_name)
rename(self, gmpxx_from_name, gmpxx_to_name)
for dep in self.dependencies.values():
if dep.cpp_info.libdirs:
copy(self, "*.lib", dep.cpp_info.libdirs[0], self.build_folder)
if dep.cpp_info.bindirs:
copy(self, "*.dll", dep.cpp_info.bindirs[0], self.build_folder)