Skip to content

[opencv4] Fix INTERFACE_LINK_LIBRARIES error#14177

Merged
BillyONeal merged 2 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/14171
Oct 30, 2020
Merged

[opencv4] Fix INTERFACE_LINK_LIBRARIES error#14177
BillyONeal merged 2 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/14171

Conversation

@JackBoosY
Copy link
Copy Markdown
Contributor

Fix configure error:

INTERFACE_LINK_LIBRARIES: optimized;F:/vcpkg/installed/x64-windows/lib/avcodec.lib;debug;F:/vcpkg/installed/x64-windows/debug/lib/avcodec.lib;optimized;F:/vcpkg/installed/x64-windows/lib/avdevice.lib;debug;F:/vcpkg/installed/x64-windows/debug/lib/avdevice.lib;optimized;F:/vcpkg/installed/x64-windows/lib/avfilter.lib;debug;F:/vcpkg/installed/x64-windows/debug/lib/avfilter.lib;optimized;F:/vcpkg/installed/x64-windows/lib/avformat.lib;debug;F:/vcpkg/installed/x64-windows/debug/lib/avformat.lib;optimized;F:/vcpkg/installed/x64-windows/lib/avresample.lib;debug;F:/vcpkg/installed/x64-windows/debug/lib/avresample.lib;optimized;F:/vcpkg/installed/x64-windows/lib/avutil.lib;debug;F:/vcpkg/installed/x64-windows/debug/lib/avutil.lib;optimized;F:/vcpkg/installed/x64-windows/lib/postproc.lib;debug;F:/vcpkg/installed/x64-windows/debug/lib/postproc.lib;optimized;F:/vcpkg/installed/x64-windows/lib/swresample.lib;debug;F:/vcpkg/installed/x64-windows/debug/lib/swresample.lib;optimized;F:/vcpkg/installed/x64-windows/lib/swscale.lib;debug;F:/vcpkg/installed/x64-windows/debug/lib/swscale.lib;optimized;wsock32;debug;wsock32;optimized;ws2_32;debug;ws2_32;optimized;secur32;debug;secur32;optimized;bcrypt;debug;bcrypt;optimized;strmiids;debug;strmiids;optimized;Vfw32;debug;Vfw32;optimized;Shlwapi;debug;Shlwapi;optimized;mfplat;debug;mfplat;optimized;mfuuid;debug;mfuuid
CMake Error at modules/videoio/cmake/init.cmake:13 (set_target_properties):
  Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword
  "optimized".  The INTERFACE_LINK_LIBRARIES property may contain
  configuration-sensitive generator-expressions which may be used to specify
  per-configuration rules.
Call Stack (most recent call first):
  modules/videoio/cmake/detect_ffmpeg.cmake:60 (ocv_add_external_target)
  modules/videoio/cmake/init.cmake:3 (include)
  modules/videoio/cmake/init.cmake:23 (add_backend)
  cmake/OpenCVModule.cmake:312 (include)
  cmake/OpenCVModule.cmake:375 (_add_modules_1)
  modules/CMakeLists.txt:7 (ocv_glob_modules)

Fixes #14171.

@JackBoosY JackBoosY added requires:discussion category:port-bug The issue is with a library, which is something the port should already support labels Oct 23, 2020
@JackBoosY
Copy link
Copy Markdown
Contributor Author

cc @cenit for review this PR.
PS: should I report this issue to the upstream & should I also fix other versions of opencv?

Copy link
Copy Markdown
Contributor

@cenit cenit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JackBoosY for the patch.
Yes it is very appropriate to back port the patch also to opencv2/3 and to suggest it also upstream

@JackBoosY
Copy link
Copy Markdown
Contributor Author

These contents did not appear in opencv2/opencv3.

@BillyONeal
Copy link
Copy Markdown
Member

I think this change is correct but want to give upstream a few days to respond; as long as they don't take explicit issue with this change I'll merge it in ~4 days (Friday)

@cenit
Copy link
Copy Markdown
Contributor

cenit commented Oct 27, 2020

These contents did not appear in opencv2/opencv3.

might be in different positions of the code maybe? Did you try if ./vcpkg install opencv3[ffmpeg] and ./vcpkg install opencv2[ffmpeg] work with the new FindFFMPEG.cmake recently rewritten?

@JackBoosY
Copy link
Copy Markdown
Contributor Author

@cenit opencv2 and opencv3 can be built successfully without this changes.

@JackBoosY JackBoosY marked this pull request as ready for review October 30, 2020 02:15
@JackBoosY
Copy link
Copy Markdown
Contributor Author

@BillyONeal Okay, the upstream accepted my PR.

@guybashan
Copy link
Copy Markdown

Just tested and PR seems to be working fine and compile without errors..

@BillyONeal
Copy link
Copy Markdown
Member

Awesome, thanks @JackBoosY !

@BillyONeal BillyONeal merged commit 6d0587f into microsoft:master Oct 30, 2020
@JackBoosY JackBoosY deleted the dev/jack/14171 branch November 3, 2020 02:31
@fishduke
Copy link
Copy Markdown

try 'vcpkg install opencv[core,dnn,ffmpeg,jpeg,opengl,png,tiff,webp,freetype]:x64-windows --recurse'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-bug The issue is with a library, which is something the port should already support info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[opencv] build failure

6 participants