-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathconanfile.py
81 lines (60 loc) · 2.61 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from conans import ConanFile, tools, VisualStudioBuildEnvironment
class CommonConan(ConanFile):
name = "SimCenterCommonQt"
version = "0.1.10"
license = "BSD"
author = "Wael Elhaddad ([email protected])"
url = "https://github.com/NHERI-SimCenter/SimCenterCommon.git"
description = "SimCenter Common Qt Library"
settings = "os", "compiler", "build_type", "arch"
generators = "qmake", "cmake"
requires = "jansson/2.13.1", "libcurl/7.72.0"
build_policy = "missing"
options = {
"MDOFwithQt3D": [True, False],
"withQt":[True, False]
}
default_options = {"MDOFwithQt3D": False, "withQt": False}
scm = {
"type": "git",
"url": "auto",
"revision": "auto"
}
def configure(self):
if self.settings.os == "Windows":
self.options["libcurl"].with_winssl = True
self.options["libcurl"].with_openssl = False
if self.options.withQt:
self.options["qt"].qtcharts = True
self.options["qt"].qt3d = True
def build_requirements(self):
if self.settings.os == "Windows":
self.build_requires("jom/1.1.3")
if self.options.withQt:
self.build_requires("qt/5.15.2")
def package_id(self):
del self.info.options.withQt
def build(self):
if self.settings.os == "Windows":
env_build = VisualStudioBuildEnvironment(self)
with tools.environment_append(env_build.vars):
vcvars = tools.vcvars_command(self.settings)
qmake = "%s && qmake" % (vcvars)
makeCommand = "%s && jom" % (vcvars)
else:
qmake = 'qmake'
makeCommand = 'make -j'
qmakeCommand = '%s "CONFIG+=%s" %s/SimCenterCommonQt.pro' % (qmake, str(self.settings.build_type).lower(), self.source_folder)
if(self.options.MDOFwithQt3D):
qmakeCommand += ' "DEFINES+=_GRAPHICS_Qt3D"'
self.run(qmakeCommand, run_environment=True)
self.run(makeCommand, run_environment=True)
def package(self):
self.copy("*.h", src="Common", dst="include", keep_path=False)
self.copy("*.h", src="InputSheetBM", dst="include", keep_path=False)
self.copy("*.h", src="RandomVariables", dst="include", keep_path=False)
self.copy("*/*.h", src="Workflow", dst="include", keep_path=False)
self.copy("*SimCenterCommonQt.lib", dst="lib", keep_path=False)
self.copy("*SimCenterCommonQt.a", dst="lib", keep_path=False)
def package_info(self):
self.cpp_info.libs = ["SimCenterCommonQt"]