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: conan v2 support + bump dependencies #13406

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1644640
bump dependencies
SpaceIm Oct 10, 2022
1d11fda
partial conan v2 support
SpaceIm Oct 10, 2022
06b0c8a
fix ffmeg check in test_package
SpaceIm Oct 10, 2022
e4f59fa
bump dependencies
SpaceIm Nov 18, 2022
96f1465
modernize more
SpaceIm Nov 18, 2022
decf8b0
bump libpng & protobuf
SpaceIm Dec 2, 2022
54c0b5f
revert to protobuf 3.21.4
SpaceIm Dec 2, 2022
c15d118
revert to protobuf 3.17.1
SpaceIm Dec 3, 2022
6e14fd7
bump harfbuzz
SpaceIm Dec 18, 2022
ebd8afb
minor changes in test package
SpaceIm Dec 18, 2022
282de12
use self.dependencies
SpaceIm Dec 18, 2022
ce9611d
uniform style
SpaceIm Dec 18, 2022
dd10cc2
fix test package when built with ffmpeg
SpaceIm Dec 18, 2022
e566a10
revert to self.deps_cpp_info
SpaceIm Dec 18, 2022
d95ebac
add TODO about a bug in self.dependencies and access to components ve…
SpaceIm Dec 18, 2022
d97c603
more elegant patch of openexr discovery in opencv 2.x
SpaceIm Dec 18, 2022
84ccc96
no self.info in validate()
SpaceIm Dec 18, 2022
60b0763
robust discovery & injection of openexr in opencv 4.x
SpaceIm Dec 19, 2022
00a6cfb
recursive rm of cmake files in opencv 2.x
SpaceIm Dec 19, 2022
764cc04
robust discovery & link to openexr in opencv 2.x
SpaceIm Dec 19, 2022
ff32135
robust discovery & link to openexr in opencv 3.x
SpaceIm Dec 19, 2022
7402b5e
propagate jpeg only if libjpeg-turbo
SpaceIm Dec 19, 2022
a57f9d2
bump harfbuzz
SpaceIm Dec 19, 2022
36cbbfc
bump jasper
SpaceIm Dec 21, 2022
2ec11da
allow mozjpeg
SpaceIm Dec 21, 2022
c4cf328
add patch fields
SpaceIm Dec 21, 2022
e04cc4f
fix patch_type
SpaceIm Dec 21, 2022
37887c4
conan v2 support of opencv 2.x
SpaceIm Dec 21, 2022
1362dcf
conan v2 support of opencv 3.x
SpaceIm Dec 21, 2022
c1dceea
conan v2 support of opencv 4.x
SpaceIm Dec 21, 2022
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
7 changes: 0 additions & 7 deletions recipes/opencv/2.x/CMakeLists.txt

This file was deleted.

6 changes: 5 additions & 1 deletion recipes/opencv/2.x/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ sources:
patches:
"2.4.13.7":
- patch_file: "patches/0001-jasper.patch"
base_path: "src"
patch_description: "Compatibility with recent jasper versions"
patch_type: "portability"
- patch_file: "patches/0002-find-openexr.patch"
patch_description: "Robust discovery & injection of OpenEXR"
patch_type: "conan"
250 changes: 103 additions & 147 deletions recipes/opencv/2.x/conanfile.py

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions recipes/opencv/2.x/patches/0002-find-openexr.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- a/cmake/OpenCVFindOpenEXR.cmake
+++ b/cmake/OpenCVFindOpenEXR.cmake
@@ -8,6 +8,15 @@
# OPENEXR_INCLUDE_PATHS = OpenEXR include directories.
# OPENEXR_LIBRARIES = libraries that are needed to use OpenEXR.
#
+find_package(OpenEXR REQUIRED)
+if(TARGET OpenEXR::OpenEXR)
+ set(OPENEXR_LIBRARIES OpenEXR::OpenEXR)
+else()
+ set(OPENEXR_LIBRARIES openexr::openexr)
+endif()
+set(OPENEXR_FOUND TRUE)
+set(OPENEXR_VERSION ${OpenEXR_VERSION})
+return()

SET(OPENEXR_LIBRARIES "")
SET(OPENEXR_LIBSEARCH_SUFFIXES "")
7 changes: 2 additions & 5 deletions recipes/opencv/2.x/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
cmake_minimum_required(VERSION 3.1)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
project(test_package LANGUAGES CXX)

find_package(OpenCV REQUIRED core CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} opencv_core)
target_link_libraries(${PROJECT_NAME} PRIVATE opencv_core)
19 changes: 14 additions & 5 deletions recipes/opencv/2.x/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
from conans import ConanFile, CMake, tools
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake, cmake_layout
import os


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package_multi"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
test_type = "explicit"

def layout(self):
cmake_layout(self)

def requirements(self):
self.requires(self.tested_reference_str)

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")
8 changes: 8 additions & 0 deletions recipes/opencv/2.x/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.1)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package
${CMAKE_CURRENT_BINARY_DIR}/test_package)
17 changes: 17 additions & 0 deletions recipes/opencv/2.x/test_v1_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from conans import ConanFile, CMake, tools
import os


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package_multi"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
12 changes: 0 additions & 12 deletions recipes/opencv/3.x/CMakeLists.txt

This file was deleted.

9 changes: 9 additions & 0 deletions recipes/opencv/3.x/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ sources:
sha256: "c8919dfb5ead6be67534bf794cb0925534311f1cd5c6680f8164ad1813c88d13"
- url: "https://github.com/opencv/opencv_contrib/archive/3.4.12.tar.gz"
sha256: "b207024589674dd2efc7c25740ef192ee4f3e0783e773e2d49a198c37e3e7570"
patches:
"3.4.17":
- patch_file: "patches/3.4.17-0001-find-openexr.patch"
patch_description: "Robust discovery & injection of OpenEXR"
patch_type: "conan"
"3.4.12":
- patch_file: "patches/3.4.12-0001-find-openexr.patch"
patch_description: "Robust discovery & injection of OpenEXR"
patch_type: "conan"
Loading