-
Notifications
You must be signed in to change notification settings - Fork 18
/
conanfile.py
55 lines (48 loc) · 2.1 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
# -*- coding: utf-8 -*-
#
from conans import python_requires
import conans.tools as tools
from conans.tools import SystemPackageTool, Version
import os
base = python_requires("Eigen3ToPython/latest@multi-contact/dev")
class EigenQuadProgConan(base.Eigen3ToPythonConan):
name = "eigen-quadprog"
version = "1.1.2"
description = "QuadProg QP solver through Eigen3 library"
topics = ("robotics", "optimization", "qp", "python")
url = "https://github.com/jrl-umi3218/eigen-quadprog"
homepage = "https://github.com/jrl-umi3218/eigen-quadprog"
author = "Pierre Gergondet <[email protected]>"
license = "BSD-2-Clause"
exports = ["LICENSE"]
exports_sources = ["CMakeLists.txt", "conan/CMakeLists.txt", "binding/*", "cmake/*", "doc/*", "src/*"]
generators = "cmake"
settings = "os", "arch", "compiler", "build_type"
requires = (
"eigen/3.3.4@conan/stable"
)
def config_options(self):
del self.options.python2_version
del self.options.python3_version
# build_requirements and system_requirements taken from https://github.com/conan-community/conan-lapack to fetch a Fortran compiler
def build_requirements(self):
if self.settings.os == "Windows":
self.build_requires("mingw_installer/latest@multi-contact/3rd-party")
elif self.settings.os == "Macos":
self.build_requires("gfortran/10.2")
def system_requirements(self):
installer = SystemPackageTool()
if tools.os_info.is_linux:
if tools.os_info.with_pacman or \
tools.os_info.with_yum:
installer.install("gcc-fortran")
else:
installer.install("gfortran")
versionfloat = Version(self.settings.compiler.version.value)
if self.settings.compiler == "gcc":
if versionfloat < "5.0":
installer.install("libgfortran-{}-dev".format(versionfloat))
else:
installer.install("libgfortran-{}-dev".format(int(versionfloat.major)))
def package_id(self):
pass