Skip to content

Commit

Permalink
mrcal: add libelas support
Browse files Browse the repository at this point in the history
Requires conan-io#23795.
  • Loading branch information
valgur committed Apr 28, 2024
1 parent 3ffb520 commit b4436a0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions recipes/mrcal/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class MrcalConan(ConanFile):

package_type = "shared-library"
settings = "os", "arch", "compiler", "build_type"
options = {
"with_libelas": [True, False],
}
default_options = {
# Disabled by default due to being GPL-licensed
"with_libelas": False,
}

def configure(self):
self.settings.rm_safe("compiler.cppstd")
Expand All @@ -34,6 +41,8 @@ def requirements(self):
# https://github.com/dkogan/libdogleg/blob/master/dogleg.h#L8
self.requires("suitesparse-cholmod/5.2.1", transitive_headers=True, transitive_libs=True)
self.requires("freeimage/3.18.0")
if self.options.with_libelas:
self.requires("libelas/cci.20150630")

def validate(self):
if self.settings.os not in ["Linux", "FreeBSD"] and not is_apple_os(self):
Expand All @@ -55,8 +64,8 @@ def generate(self):
env = VirtualRunEnv(self)
env.generate(scope="build")
tc = AutotoolsToolchain(self)
# TODO: add libelas to CCI
# tc.make_args.append("USE_LIBELAS=1")
if self.options.with_libelas:
tc.make_args.append("USE_LIBELAS=1")
tc.extra_cflags.append("-Ilibdogleg")
tc.extra_ldflags.append("-Llibdogleg")
tc.generate()
Expand Down

0 comments on commit b4436a0

Please sign in to comment.