[opencv4] Fix freetype, harfbuzz, gtk dependencies (#27343)

* Fix freetype and harfbuzz dependencies

* Revise gtk feature

* Merge copyright and license files

* Update versions

* Add feature gtk 'supports' expression

* Update versions
This commit is contained in:
Kai Pastor 2022-10-26 05:49:57 +02:00 committed by GitHub
parent f47e55e234
commit f3ab3f6a28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 26 deletions

View File

@ -1,14 +1,11 @@
--- a/modules/gapi/cmake/init.cmake
+++ b/modules/gapi/cmake/init.cmake
@@ -20,10 +20,8 @@ if(NOT TARGET ade)
@@ -20,7 +20,7 @@ if(NOT TARGET ade)
endif()
if(WITH_FREETYPE)
- ocv_check_modules(FREETYPE freetype2)
- if (FREETYPE_FOUND)
+ find_package(freetype CONFIG REQUIRED)
+ find_package(Freetype REQUIRED)
if (FREETYPE_FOUND)
set(HAVE_FREETYPE TRUE)
- endif()
endif()
if(WITH_PLAIDML)
endif()

View File

@ -1,14 +1,15 @@
--- a/modules/freetype/CMakeLists.txt
+++ b/modules/freetype/CMakeLists.txt
@@ -3,8 +5,10 @@ if(APPLE_FRAMEWORK)
@@ -3,8 +5,11 @@ if(APPLE_FRAMEWORK)
ocv_module_disable(freetype)
endif()
-ocv_check_modules(FREETYPE freetype2)
-ocv_check_modules(HARFBUZZ harfbuzz)
+if(WITH_FREETYPE)
+find_package(freetype CONFIG REQUIRED)
+find_package(harfbuzz CONFIG REQUIRED)
+ find_package(Freetype REQUIRED)
+ find_package(HARFBUZZ NAMES harfbuzz REQUIRED)
+ set(HARFBUZZ_LIBRARIES harfbuzz::harfbuzz)
+endif()
if(OPENCV_INITIAL_PASS)

View File

@ -56,6 +56,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
"freetype" WITH_FREETYPE
"gdcm" WITH_GDCM
"gstreamer" WITH_GSTREAMER
"gtk" WITH_GTK
"halide" WITH_HALIDE
"jasper" WITH_JASPER
"jpeg" WITH_JPEG
@ -83,15 +84,6 @@ if("dnn" IN_LIST FEATURES)
endif()
endif()
set(WITH_GTK OFF)
if("gtk" IN_LIST FEATURES)
if(VCPKG_TARGET_IS_LINUX)
set(WITH_GTK ON)
else()
message(WARNING "The gtk module cannot be enabled outside Linux")
endif()
endif()
set(WITH_QT OFF)
if("qt" IN_LIST FEATURES)
set(WITH_QT ${USE_QT_VERSION})
@ -502,6 +494,9 @@ enable_language(C)
find_dependency(HDF5)
find_dependency(Tesseract)")
endif()
if(WITH_CONTRIB AND WITH_FREETYPE)
string(APPEND DEPS_STRING "\nfind_dependency(harfbuzz)")
endif()
if(WITH_TBB)
string(APPEND DEPS_STRING "\nfind_dependency(TBB)")
endif()
@ -524,7 +519,7 @@ find_dependency(Tesseract)")
string(APPEND DEPS_STRING "\nfind_dependency(OpenMP)")
endif()
if(BUILD_opencv_ovis)
string(APPEND DEPS_STRING "\nfind_dependency(Ogre)\nfind_dependency(freetype)")
string(APPEND DEPS_STRING "\nfind_dependency(Ogre)")
endif()
if("quirc" IN_LIST FEATURES)
string(APPEND DEPS_STRING "\nfind_dependency(quirc)")
@ -584,4 +579,6 @@ vcpkg_fixup_pkgconfig()
configure_file("${CURRENT_PORT_DIR}/usage.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(GLOB extra_license_files "${CURRENT_PACKAGES_DIR}/share/licenses/opencv4/*")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE" ${extra_license_files})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/licenses")

View File

@ -1,7 +1,7 @@
{
"name": "opencv4",
"version": "4.6.0",
"port-version": 6,
"port-version": 7,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"license": "Apache-2.0",
@ -130,8 +130,14 @@
"freetype": {
"description": "Freetype support for opencv",
"dependencies": [
"freetype",
"harfbuzz"
{
"name": "freetype",
"default-features": false
},
{
"name": "harfbuzz",
"default-features": false
}
]
},
"gdcm": {
@ -148,8 +154,12 @@
},
"gtk": {
"description": "GTK support for opencv",
"supports": "!windows & !osx & !ios & !android",
"dependencies": [
"gtk"
{
"name": "gtk3",
"default-features": false
}
]
},
"halide": {

View File

@ -5426,7 +5426,7 @@
},
"opencv4": {
"baseline": "4.6.0",
"port-version": 6
"port-version": 7
},
"opendnp3": {
"baseline": "3.1.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f8f6d4451f824e2247a7e33c3f092cd836eb336b",
"version": "4.6.0",
"port-version": 7
},
{
"git-tree": "9961bbcc88c934054f6137f3417bbd9cccf478d4",
"version": "4.6.0",