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

Skip to content

CMake install target on Windows does not install libs into correct subdirs #25697

@MrMoose

Description

@MrMoose

System Information

OpenCV version: 4.9.0
Operating System / Platform: Windows (11)
Compiler & compiler version: MSVC17 (Visual Studio 2022)

Detailed description

I'm building a custom and quite minimal OpenCV from source using CMake. The build runs through but the resulting installed package could not be found by CMake find_package(). Debugging into it I noticed it is installed into the wrong folders.

The resulting installed dir contains:

etc
include
staticlib
LICENSE
OpenCVConfig-version.cmake
OpenCVConfig.cmake
setup_vars_opencv4.cmd

and in staticlib there is:

OpenCVConfig-version.cmake
OpenCVConfig.cmake
OpenCVModules-release.cmake
OpenCVModules.cmake
opencv_core490.lib
opencv_features2d490.lib
opencv_flann490.lib
opencv_highgui490.lib
opencv_imgproc490.lib
opencv_video490.lib

According to the CMake finders and examples in the web the directory is supposed to be x64\vc17\staticlib.
As a result, CMake finders cannot find the package, which I consider a serious issue.

Steps to reproduce

Here's my CMake parameters:

        ("BUILD_SHARED_LIBS:BOOL", "OFF"),
        ("BUILD_TESTS:BOOL", "OFF"),
        ("BUILD_PERF_TESTS:BOOL", "OFF"),
        ("BUILD_WITH_STATIC_CRT:BOOL", "OFF"),

        ("BUILD_OPENJPEG:BOOL", "OFF"),
        ("BUILD_IPP_IW:BOOL", "OFF"),
        ("BUILD_ITT:BOOL", "OFF"),
        ("BUILD_JASPER:BOOL", "OFF"),
        ("BUILD_JPEG:BOOL", "OFF"),
        ("BUILD_ITT:BOOL", "OFF"),
        ("BUILD_JAVA:BOOL", "OFF"),
        ("BUILD_PNG:BOOL", "OFF"),
        ("BUILD_PROTOBUF:BOOL", "OFF"),
        ("BUILD_TIFF:BOOL", "OFF"),
        ("BUILD_WEBP:BOOL", "OFF"),
        ("BUILD_VTK:BOOL", "OFF"),
        ("BUILD_ZLIB:BOOL", "OFF"),

        ("BUILD_opencv_apps:BOOL", "OFF"),
        ("BUILD_opencv_calib3d:BOOL", "OFF"),
        ("BUILD_opencv_dnn:BOOL", "OFF"),
        ("BUILD_opencv_features2d:BOOL", "OFF"),
        ("BUILD_opencv_flann:BOOL", "OFF"),
        ("BUILD_opencv_imgcodecs:BOOL", "OFF"),
        ("BUILD_opencv_java_bindings_generator:BOOL", "OFF"),
        ("BUILD_opencv_js_bindings_generator:BOOL", "OFF"),
        ("BUILD_opencv_objc_bindings_generator:BOOL", "OFF"),
        ("BUILD_opencv_objdetect:BOOL", "OFF"),
        ("BUILD_opencv_ml:BOOL", "OFF"),
        ("BUILD_opencv_photo:BOOL", "OFF"),
        ("BUILD_opencv_python3:BOOL", "OFF"),
        ("BUILD_opencv_python_bindings_generator:BOOL", "OFF"),
        ("BUILD_opencv_python_tests:BOOL", "OFF"),

        ("DNN_ENABLE_PLUGINS:BOOL", "OFF"),
        ("HIGHGUI_ENABLE_PLUGINS:BOOL", "OFF"),

        ("WITH_ADE:BOOL", "OFF"),
        ("WITH_DIRECTML:BOOL", "OFF"),
        ("WITH_DIRECTX:BOOL", "OFF"),
        ("WITH_DSHOW:BOOL", "OFF"),
        ("WITH_EIGEN:BOOL", "OFF"),
      
        ("WITH_FLATBUFFERS:BOOL", "OFF"),
        ("WITH_IMGCODEC_HDR:BOOL", "OFF"),
        ("WITH_IMGCODEC_PFM:BOOL", "OFF"),
        ("WITH_IMGCODEC_PXM:BOOL", "OFF"),
        ("WITH_IMGCODEC_SUNRASTER:BOOL", "OFF"),
        ("WITH_IPP:BOOL", "OFF"),
        ("WITH_ITT:BOOL", "OFF"),
        ("WITH_JASPER:BOOL", "OFF"),
        ("WITH_JPEG:BOOL", "OFF"),
        ("WITH_LAPACK:BOOL", "OFF"),
        ("WITH_MSMF:BOOL", "OFF"),
        ("WITH_MSMF_DXVA:BOOL", "OFF"),
        ("WITH_OBSENSOR:BOOL", "OFF"),
        ("WITH_OPENCL:BOOL", "OFF"),
        ("WITH_OPENCLAMDBLAS:BOOL", "OFF"),
        ("WITH_OPENCLAMDFFT:BOOL", "OFF"),
        ("WITH_OPENEXR:BOOL", "OFF"),
        ("WITH_OPENJPEG:BOOL", "OFF"),
        ("WITH_PNG:BOOL", "OFF"),
        ("WITH_PROTOBUF:BOOL", "OFF"),
        ("WITH_TIFF:BOOL", "OFF"),
        ("WITH_WEBP:BOOL", "OFF"),
        ("WITH_WIN32UI:BOOL", "OFF"),
        ("WITH_VTK:BOOL", "OFF"),

Build from source on Windows, observe subdir.

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

    Labels

    question (invalid tracker)ask questions and other "no action" items here: https://forum.opencv.org

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions