1 from conans
import ConanFile, tools, VisualStudioBuildEnvironment
4 name =
"SimCenterCommonQt" 7 author =
"Wael Elhaddad (elhaddad@berkeley.edu)" 8 url =
"https://github.com/NHERI-SimCenter/SimCenterCommon.git" 9 description =
"SimCenter Common Qt Library" 10 settings =
"os",
"compiler",
"build_type",
"arch" 11 generators =
"qmake",
"cmake" 12 requires =
"jansson/2.11@bincrafters/stable",
"libcurl/7.64.1@bincrafters/stable" 13 build_policy =
"missing" 16 "MDOFwithQt3D": [
True,
False],
17 "withQt":[
True,
False]
21 default_options = {
"MDOFwithQt3D":
False,
"withQt":
False}
31 if self.settings.os ==
"Windows":
32 self.
options[
"libcurl"].with_winssl =
True 33 self.
options[
"libcurl"].with_openssl =
False 35 if self.options.withQt:
36 self.
options[
"qt"].qtcharts =
True 41 if self.settings.os ==
"Windows":
42 self.build_requires(
"jom_installer/1.1.2@bincrafters/stable")
44 if self.options.withQt:
45 self.build_requires(
"qt/5.11.3@bincrafters/stable")
49 del self.info.options.withQt
53 if self.settings.os ==
"Windows":
54 env_build = VisualStudioBuildEnvironment(self)
55 with tools.environment_append(env_build.vars):
56 vcvars = tools.vcvars_command(self.
settings)
58 qmake =
"%s && qmake" % (vcvars)
59 makeCommand =
"%s && jom" % (vcvars)
62 makeCommand =
'make -j' 64 qmakeCommand =
'%s "CONFIG+=%s" %s/SimCenterCommonQt.pro' % (qmake, str(self.settings.build_type).lower(), self.source_folder)
65 if(self.options.MDOFwithQt3D):
66 qmakeCommand +=
' "DEFINES+=_GRAPHICS_Qt3D"' 68 self.run(qmakeCommand, run_environment=
True)
69 self.run(makeCommand, run_environment=
True)
73 self.copy(
"*.h", src=
"Common", dst=
"include", keep_path=
False)
74 self.copy(
"*.h", src=
"InputSheetBM", dst=
"include", keep_path=
False)
75 self.copy(
"*.h", src=
"RandomVariables", dst=
"include", keep_path=
False)
76 self.copy(
"*/*.h", src=
"Workflow", dst=
"include", keep_path=
False)
77 self.copy(
"*SimCenterCommonQt.lib", dst=
"lib", keep_path=
False)
78 self.copy(
"*SimCenterCommonQt.a", dst=
"lib", keep_path=
False)
82 self.cpp_info.libs = [
"SimCenterCommonQt"]
def build_requirements(self)