From c15ea56bf49bee4d7d7c76c1fbc7581b5544ffe1 Mon Sep 17 00:00:00 2001 From: Petukhov Maksim Date: Fri, 7 Jul 2023 13:03:55 +0300 Subject: [PATCH 1/5] add jpeg option --- recipes/openmvg/all/conanfile.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/recipes/openmvg/all/conanfile.py b/recipes/openmvg/all/conanfile.py index cb31a55747055..0ba6c7295db1f 100644 --- a/recipes/openmvg/all/conanfile.py +++ b/recipes/openmvg/all/conanfile.py @@ -30,6 +30,7 @@ class Openmvgconan(ConanFile): "with_openmp": [True, False], "with_avx": [False, "avx", "avx2"], "programs": [True, False], + "jpeg": ["libjpeg", "libjpeg-turbo"] } default_options = { "shared": False, @@ -37,6 +38,7 @@ class Openmvgconan(ConanFile): "with_openmp": False, "with_avx": False, "programs": True, + "jpeg": "libjpeg" } short_paths = True @@ -66,7 +68,10 @@ def requirements(self): self.requires("coin-utils/2.11.6") self.requires("eigen/3.4.0", transitive_headers=True) self.requires("flann/1.9.2", transitive_headers=True, transitive_libs=True) - self.requires("libjpeg/9e") + if self.options.jpeg == "jpeg": + self.requires("libjpeg/9e") + elif self.options.jpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") self.requires("libpng/1.6.39") self.requires("libtiff/4.5.0") @@ -131,6 +136,12 @@ def package(self): @property def _openmvg_components(self): + def jpeg(): + if self.options.jpeg == "jpeg": + return ["libjpeg::libjpeg"] + elif self.options.jpeg == "libjpeg-turbo": + return ["libjpeg-turbo::jpeg"] + return { "openmvg_camera": { "target": "openMVG_camera", @@ -162,7 +173,7 @@ def _openmvg_components(self): "openmvg_image": { "target": "openMVG_image", "libs": ["openMVG_image"], - "requires": ["openmvg_numeric", "libjpeg::libjpeg", "libpng::libpng", "libtiff::libtiff"], + "requires": ["openmvg_numeric", "libpng::libpng", "libtiff::libtiff"] + jpeg(), }, "openmvg_linearprogramming": { "target": "openMVG_linearProgramming", From 312de4008fda4444d070139af83d5baa7423e649 Mon Sep 17 00:00:00 2001 From: Petukhov Maksim Date: Fri, 7 Jul 2023 13:07:13 +0300 Subject: [PATCH 2/5] fix --- recipes/openmvg/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/openmvg/all/conanfile.py b/recipes/openmvg/all/conanfile.py index 0ba6c7295db1f..d02196f4b4735 100644 --- a/recipes/openmvg/all/conanfile.py +++ b/recipes/openmvg/all/conanfile.py @@ -68,7 +68,7 @@ def requirements(self): self.requires("coin-utils/2.11.6") self.requires("eigen/3.4.0", transitive_headers=True) self.requires("flann/1.9.2", transitive_headers=True, transitive_libs=True) - if self.options.jpeg == "jpeg": + if self.options.jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.jpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/2.1.5") @@ -137,7 +137,7 @@ def package(self): @property def _openmvg_components(self): def jpeg(): - if self.options.jpeg == "jpeg": + if self.options.jpeg == "libjpeg": return ["libjpeg::libjpeg"] elif self.options.jpeg == "libjpeg-turbo": return ["libjpeg-turbo::jpeg"] From 9c0f4d577ec995d2c3034eda4ae8d81b06358c64 Mon Sep 17 00:00:00 2001 From: Petukhov Maksim Date: Fri, 7 Jul 2023 14:30:06 +0300 Subject: [PATCH 3/5] review --- recipes/openmvg/all/conanfile.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/recipes/openmvg/all/conanfile.py b/recipes/openmvg/all/conanfile.py index d02196f4b4735..2bc70d372e406 100644 --- a/recipes/openmvg/all/conanfile.py +++ b/recipes/openmvg/all/conanfile.py @@ -30,7 +30,7 @@ class Openmvgconan(ConanFile): "with_openmp": [True, False], "with_avx": [False, "avx", "avx2"], "programs": [True, False], - "jpeg": ["libjpeg", "libjpeg-turbo"] + "with_jpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg"] } default_options = { "shared": False, @@ -38,7 +38,7 @@ class Openmvgconan(ConanFile): "with_openmp": False, "with_avx": False, "programs": True, - "jpeg": "libjpeg" + "with_jpeg": "libjpeg" } short_paths = True @@ -68,10 +68,12 @@ def requirements(self): self.requires("coin-utils/2.11.6") self.requires("eigen/3.4.0", transitive_headers=True) self.requires("flann/1.9.2", transitive_headers=True, transitive_libs=True) - if self.options.jpeg == "libjpeg": + if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") - elif self.options.jpeg == "libjpeg-turbo": + elif self.options.with_jpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/2.1.5") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.1") self.requires("libpng/1.6.39") self.requires("libtiff/4.5.0") @@ -137,10 +139,12 @@ def package(self): @property def _openmvg_components(self): def jpeg(): - if self.options.jpeg == "libjpeg": + if self.options.with_jpeg == "libjpeg": return ["libjpeg::libjpeg"] - elif self.options.jpeg == "libjpeg-turbo": + elif self.options.with_jpeg == "libjpeg-turbo": return ["libjpeg-turbo::jpeg"] + elif self.options.with_jpeg == "mozjpeg": + return ["mozjpeg::libjpeg"] return { "openmvg_camera": { From c9500d067e724639cbaa0c9132e51fdb602c5a61 Mon Sep 17 00:00:00 2001 From: Maksim Petukhov <6967052+maksim-petukhov@users.noreply.github.com> Date: Fri, 4 Aug 2023 13:56:01 +0300 Subject: [PATCH 4/5] Update recipes/openmvg/all/conanfile.py Co-authored-by: Martin Valgur --- recipes/openmvg/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openmvg/all/conanfile.py b/recipes/openmvg/all/conanfile.py index ea2afdb065d94..c35da1a5e25b2 100644 --- a/recipes/openmvg/all/conanfile.py +++ b/recipes/openmvg/all/conanfile.py @@ -71,7 +71,7 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.0") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.1") self.requires("libpng/1.6.40") From b041cb2e0062210eae7991f7283d527624ec7394 Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Mon, 14 Aug 2023 16:02:12 +0100 Subject: [PATCH 5/5] add workaround for build rpath issue on Linux --- recipes/openmvg/all/conanfile.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes/openmvg/all/conanfile.py b/recipes/openmvg/all/conanfile.py index c35da1a5e25b2..6774e8b893191 100644 --- a/recipes/openmvg/all/conanfile.py +++ b/recipes/openmvg/all/conanfile.py @@ -115,6 +115,12 @@ def generate(self): # see https://github.com/conan-io/conan/issues/10281 if Version(self.dependencies["ceres-solver"].ref.version) >= "2.0.0" and not valid_min_cppstd(self, "14"): tc.variables["CMAKE_CXX_STANDARD"] = "14" + + if self.settings.os == "Linux": + # Workaround for: https://github.com/conan-io/conan/issues/13560 + libdirs_host = [l for dependency in self.dependencies.host.values() for l in dependency.cpp_info.aggregated_components().libdirs] + tc.variables["CMAKE_BUILD_RPATH"] = ";".join(libdirs_host) + tc.generate() deps = CMakeDeps(self)