Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opencv 4.x: re-enable quirc by default #23242

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions recipes/opencv/4.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class OpenCVConan(ConanFile):
"with_msmf": True,
"with_msmf_dxva": True,
# objdetect module options
"with_quirc": False,
"with_quirc": True,
# videoio module options
"with_ffmpeg": True,
"with_v4l": False,
Expand Down Expand Up @@ -351,9 +351,6 @@ def config_options(self):
if not self._has_with_wayland_option:
self.options.with_gtk = True

if Version(self.version) >= "4.9":
self.options.with_quirc = True

@property
def _opencv_modules(self):
def imageformats_deps():
Expand Down Expand Up @@ -1241,9 +1238,9 @@ def _patch_sources(self):
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "ANDROID OR NOT UNIX", "FALSE")
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "elseif(EMSCRIPTEN)", "elseif(QNXNTO)\nelseif(EMSCRIPTEN)")

if self.options.with_quirc:
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(3rdparty/quirc)", "# add_subdirectory(3rdparty/quirc)")

## Upstream CMakeLists vendors quirc in CMakeLists of 3rdparty/quirc.
## Instead we rely on find-quirc.patch in order to link external quirc.
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "add_subdirectory(3rdparty/quirc)", "")

## Fix link to several dependencies
replace_in_file(self, os.path.join(self.source_folder, "modules", "imgcodecs", "CMakeLists.txt"), "JASPER_", "Jasper_")
Expand Down Expand Up @@ -1492,8 +1489,6 @@ def generate(self):
if self.options.get_safe("with_protobuf"):
tc.variables["PROTOBUF_UPDATE_FILES"] = True
tc.variables["WITH_ADE"] = self.options.gapi
if self.options.objdetect:
tc.variables["HAVE_QUIRC"] = self.options.with_quirc # force usage of quirc requirement

# Extra modules
if any([self.options.get_safe(module) for module in OPENCV_EXTRA_MODULES_OPTIONS]) or self.options.with_cuda:
Expand Down
Loading