Skip to content

Fix cmake configure error#18658

Merged
alalek merged 3 commits intoopencv:masterfrom
JackBoosY:master
Oct 29, 2020
Merged

Fix cmake configure error#18658
alalek merged 3 commits intoopencv:masterfrom
JackBoosY:master

Conversation

@JackBoosY
Copy link
Copy Markdown
Contributor

Fix configure error using cmake 3.18.*:

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)

Related PR: microsoft/vcpkg#14177

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@mshabunin
Copy link
Copy Markdown
Contributor

This patch causes failures in our CI:

CMake Error at modules/videoio/cmake/init.cmake:16 (target_link_libraries):
  Cannot specify link libraries for target "ocv.3rdparty.ffmpeg" which is not
  built by this project.
Call Stack (most recent call first):
  modules/videoio/cmake/detect_ffmpeg.cmake:101 (ocv_add_external_target)
  modules/videoio/cmake/init.cmake:3 (include)
  modules/videoio/cmake/init.cmake:22 (add_backend)
  cmake/OpenCVModule.cmake:312 (include)
  cmake/OpenCVModule.cmake:375 (_add_modules_1)
  modules/CMakeLists.txt:7 (ocv_glob_modules)

@JackBoosY
Copy link
Copy Markdown
Contributor Author

JackBoosY commented Oct 27, 2020

Does this issue related to the cmake version?
And which version of cmake is used in the CI system?

@mshabunin
Copy link
Copy Markdown
Contributor

mshabunin commented Oct 27, 2020

It is different on different machines: https://pullrequest.opencv.org/#/summary/

Windows machines have fresh versions: e.g. 3.18.
Linux machines use cmake from system packages: e.g. 3.5.1 on Ubuntu 16.04.

We declare support for cmake>=3.5.1 on master branch.

@JackBoosY
Copy link
Copy Markdown
Contributor Author

@mshabunin @alalek Should be okay now.

@alalek alalek merged commit 56d2b71 into opencv:master Oct 29, 2020
@alalek alalek mentioned this pull request Nov 27, 2020
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
* Fix cmake configure error

* judge the cmake version

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants