Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
4 tasks done
MrMoose opened this issue Jun 3, 2024 · 3 comments
Closed
4 tasks done
Labels
question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org

Comments

@MrMoose
Copy link

MrMoose commented Jun 3, 2024

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)
@MrMoose MrMoose added the bug label Jun 3, 2024
@MrMoose MrMoose changed the title CMake install target on Wndows does not install libs into correct subdirs CMake install target on Windows does not install libs into correct subdirs Jun 3, 2024
@opencv-alalek opencv-alalek added question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org and removed bug labels Jun 3, 2024
@MrMoose
Copy link
Author

MrMoose commented Jun 6, 2024

This might actually be a bug in MSVC 17.10. Others have this problem too. I reported it there with additional info. Not sure though
https://developercommunity.visualstudio.com/t/Various-build-systems-fail-after-updatin/10677302

@opencv-alalek
Copy link
Contributor

Try the latest OpenCV version or apply these patches: #25632 and #25638

@MrMoose
Copy link
Author

MrMoose commented Jun 7, 2024

Yes, it boiled down to the re-versioning of the toolchain from 14.3 to 14.4. Didn't know you already had this patched. I can confirm the fix. Closing this.

@MrMoose MrMoose closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org
Projects
None yet
Development

No branches or pull requests

2 participants