Skip to content

Commit

Permalink
(#25464) libheif: add with_openjph
Browse files Browse the repository at this point in the history
* libheif: add with_openjph

* Disable doc building

---------

Co-authored-by: Abril Rincón Blanco <[email protected]>
  • Loading branch information
toge and AbrilRBS authored Oct 1, 2024
1 parent 892638e commit 44ce640
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions recipes/libheif/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class LibheifConan(ConanFile):
"with_dav1d": [True, False],
"with_jpeg": [True, False],
"with_openjpeg": [True, False],
"with_openjph": [True, False],
}
default_options = {
"shared": False,
Expand All @@ -37,6 +38,7 @@ class LibheifConan(ConanFile):
"with_dav1d": False,
"with_jpeg": False,
"with_openjpeg": False,
"with_openjph": False,
}

def export_sources(self):
Expand All @@ -48,6 +50,8 @@ def config_options(self):
if Version(self.version) < "1.17.0":
del self.options.with_jpeg
del self.options.with_openjpeg
if Version(self.version) < "1.18.0":
del self.options.with_openjph

def configure(self):
if self.options.shared:
Expand All @@ -69,6 +73,8 @@ def requirements(self):
self.requires("libjpeg/9f")
if self.options.get_safe("with_openjpeg"):
self.requires("openjpeg/2.5.2")
if self.options.get_safe("with_openjph"):
self.requires("openjph/0.16.0", transitive_headers=False)

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
Expand Down Expand Up @@ -98,10 +104,15 @@ def generate(self):
tc.variables["WITH_JPEG_ENCODER"] = self.options.get_safe("with_jpeg", False)
tc.variables["WITH_OpenJPEG_DECODER"] = self.options.get_safe("with_openjpeg", False)
tc.variables["WITH_OpenJPEG_ENCODER"] = self.options.get_safe("with_openjpeg", False)
tc.variables["WITH_OPENJPH_ENCODER"] = self.options.get_safe("with_openjph", False)
# Disable finding possible Doxygen in system, so no docs are built
tc.variables["CMAKE_DISABLE_FIND_PACKAGE_Doxygen"] = True

tc.generate()
deps = CMakeDeps(self)
if Version(self.version) >= "1.18.0":
deps.set_property("libde265", "cmake_file_name", "LIBDE265")
deps.set_property("openjph", "cmake_file_name", "OPENJPH")
deps.generate()
if Version(self.version) >= "1.18.0":
venv = VirtualBuildEnv(self)
Expand Down Expand Up @@ -153,3 +164,5 @@ def package_info(self):
self.cpp_info.components["heif"].requires.append("libjpeg::libjpeg")
if self.options.get_safe("with_openjpeg"):
self.cpp_info.components["heif"].requires.append("openjpeg::openjpeg")
if self.options.get_safe("with_openjph"):
self.cpp_info.components["heif"].requires.append("openjph::openjph")

0 comments on commit 44ce640

Please sign in to comment.