Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Mismatch detected for 'RuntimeLibrary' when compiling with CMP0091 #24177

@caoyangjiang

Description

@caoyangjiang

System Information

OpenCV version: 4.8.0
Operating System / Platform: Windows 11
Compiler & compiler version: Visual Studio 2022

Detailed description

When compiling with cuda support and cmake policy CMP0091, compilation fails with "mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in algorithm.obj"

Steps to reproduce

  • clone opencv
git clone http://github.com/opencv/opencv
  • clone opencv-contrib
git clone http://github.com/opencv/opencv-contrib
  • create build folder
cd opencv
mkdir build
cd build
  • run cmake
cmake -DWITH_CUDA=on -DBUILD_SHARED_LIBS=on -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DOPENCV_EXTRA_MODULES_PATH="..\..\opencv_contrib\modules\" ..
  • run build:
cmake --build . --config Release

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions