vcpkg/versions
Wentsing Nee 44fb94f7a1
[opencv4] Fix build failure when dnn feature is not enabled (#38594)
Given the following manifest (when `dnn` feature is not included):

```json
"dependencies": [
  {
    "name": "opencv4",
    "version>=": "4.8.0#18",
    "default-features": false,
    "features": [
      "png"
    ]
  }
]
```

it failed and here is what
`vcpkg/buildtrees/opencv4/config-x64-linux-out.log` said:

```
...
CMake Error at /home/peter/open-source/git/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package):
  Could not find a package configuration file provided by "flatbuffers" with
  any of the following names:

    flatbuffersConfig.cmake
    flatbuffers-config.cmake

  Add the installation prefix of "flatbuffers" to CMAKE_PREFIX_PATH or set
  "flatbuffers_DIR" to a directory containing one of the above files.  If
  "flatbuffers" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:759 (find_package)
...
```

This problem is introduced by [commit
6d2c9714](6d2c971458)
contributed by @jimwang118

In the patch `vcpkg/ports/opencv4/0023-fix-no-flatbuffers.patch`, Jim
disabled the procedure of `Flatbuffers` detection introduced by the
previous patch `0017-fix-flatbuffers.patch`, which has correctly fixed
the `flatbuffers`-related issues.

```patch
...
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -756,7 +756,7 @@ include(cmake/OpenCVFindLibsVideo.cmake)
 include(cmake/OpenCVFindLibsPerf.cmake)
 include(cmake/OpenCVFindLAPACK.cmake)
 include(cmake/OpenCVFindProtobuf.cmake)
-include(cmake/OpenCVDetectFlatbuffers.cmake)
+find_package(flatbuffers CONFIG REQUIRED)
...
```

In `vcpkg/ports/opencv4/vcpkg.json` we can see, `flatbuffers` is only
the dependency of feature `dnn`:

```json
  "dependencies": [
...
    "dnn": {
      "description": "Enable dnn module",
      "dependencies": [
        "flatbuffers",
        {
          "name": "flatbuffers",
          "host": true,
          "default-features": false
        },
        "protobuf"
      ]
    },
...
```

and when `dnn` is not enabled, it broke down at the line
`find_package(flatbuffers CONFIG REQUIRED)`

And this change is unnecessary either:

```patch
-  list(APPEND libs ocv.3rdparty.flatbuffers)
+  list(APPEND libs flatbuffers::flatbuffers)
```

Thus, we'd better to revert those changes.

Co-authored-by: WentsingNee <8090395+wentsingnee@user.noreply.gitee.com>
2024-05-07 20:38:17 -07:00
..
3- [3fd|python3] switch to vcpkg-msbuild (#33026) 2023-08-09 10:29:22 -07:00
7- [7zip] Switch download source to github (#36228) 2024-01-24 09:57:01 -08:00
a- [azure-*-cpp] Update to May Releases (#38619) 2024-05-07 20:25:26 -07:00
b- [bond] Fixed compilation error under Windows when msvc version is greater than or equal to 1915 (#38471) 2024-04-30 11:31:53 -07:00
c- [folly related] update to 05.06 (#38593) 2024-05-07 14:45:30 -07:00
d- [daw-header-libraries] Update to v2.106.0 (#38603) 2024-05-07 14:39:35 -07:00
e- [entt] update to 3.13.2 (#38154) 2024-04-15 13:10:24 -04:00
f- [folly related] update to 05.06 (#38593) 2024-05-07 14:45:30 -07:00
g- [google-cloud-cpp] update to the latest release (2.24.0) (#38524) 2024-05-07 20:30:17 -07:00
h- [hareflow] Minor update + add vcpkg_cmake_config_fixup (#38245) 2024-04-19 07:41:50 -04:00
i- [igraph] update to 0.10.12 (#38598) 2024-05-07 14:41:05 -07:00
j- [Jsonifier] to v0.9.95 and [DiscordCoreAPI] to v2.0.6 (#38556) 2024-05-03 15:26:46 -07:00
k- [krb5, curl] Add new port, and add new feature curl[gssapi] (#38402) 2024-05-06 12:59:50 -07:00
l- [libcap] Use official tarballs (#38599) 2024-05-07 20:33:09 -07:00
m- [folly related] update to 05.06 (#38593) 2024-05-07 14:45:30 -07:00
n- [ports downstream from boost] Fix boost dependencies (#38421) 2024-04-26 11:27:30 -07:00
o- [opencv4] Fix build failure when dnn feature is not enabled (#38594) 2024-05-07 20:38:17 -07:00
p- [folly related] update to 05.06 (#38593) 2024-05-07 14:45:30 -07:00
q- [many ports] Don't depend on default features of tiff (#38049) 2024-05-01 19:40:19 -07:00
r- [robotraconteur] Update to version v1.2.0 (#38573) 2024-05-06 12:45:25 -07:00
s- [simde] update to 0.8.2 (#38613) 2024-05-07 12:39:34 -07:00
t- [tinyorm] Update to v0.37.3 (#38388) 2024-05-06 14:22:11 -07:00
u- [usd] update to v24.05 (#38552) 2024-05-03 15:27:30 -07:00
v- [vcpkg-pkgconfig-get-modules] Turn into proper helper port (#37939) 2024-05-01 19:51:16 -07:00
w- [folly related] update to 05.06 (#38593) 2024-05-07 14:45:30 -07:00
x- [xaudio2redist] Code cleanup for port (#37455) 2024-03-15 18:38:47 -07:00
y- [yomm2] Update to v1.5.1 (#38450) 2024-04-29 09:07:01 -04:00
z- [zstd] Update to version 1.5.6. (#38080) 2024-04-15 13:39:47 -04:00
baseline.json [opencv4] Fix build failure when dnn feature is not enabled (#38594) 2024-05-07 20:38:17 -07:00