microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.01k stars 6.35k forks source link

opencv/hdf5/Iconv #30992

Closed UredNuubjuz closed 1 year ago

UredNuubjuz commented 1 year ago

Operating system

Windows

Compiler

MSVC

Steps to reproduce the behavior

-cd build
-cmake ..

Failure logs

CMake Error at C:/src/vcpkg/installed/x64-windows-static/share/opencv4/OpenCVModules.cmake:109 (set_target_properties):
  The link interface of target "opencv_hdf" contains:

    hdf5::hdf5-static

  but the target was not found.
CMake Error at CMakeLists.txt:32 (target_link_libraries):
  Target "IMO" links to:

    hdf5::hdf5-static

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.
CMake Error at C:/src/vcpkg/installed/x64-windows-static/share/opencv4/OpenCVModules.cmake:369 (set_target_properties):
  The link interface of target "opencv_wechat_qrcode" contains:

    Iconv::Iconv

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Additional context

I am really unsure if i should ask here or in a cmake forum since i dont know if my issue is with the installation via vcpkg, or if its a problem with cmake. i did search a bunch of forums and i dont understand most of it. From my understanding the target "IMO" (my project name) cannot link to the target hdf5-static and iconv. cmakelists.txt

LilyWangLL commented 1 year ago

Thanks for posting this issue. If you use manifest mode, could you also provide your vcpkg.json file?

UredNuubjuz commented 1 year ago

i cant find a vcpkg.json file, but besides that, i think i solved it somewhat. my problem was, that i was not able to call my toolchain file (vcpkg.cmake) after i call my project in my cmakelists.txt file. the error message disappeared after i changed it. i still have an issue tho. i suspect that the issue is cmake but i will describe it as good as possible. right now cmake is confusing the dynamic and static library of hdf5. i wasnt aware of the difference between the two and just installed the dynamic library. after trying to build my project, i figured out that it does not work. i then installed the static library and uninstalled the dynamic library. right now cmake is looking for a file in the dynamic installation but it should search for it in the static installation. long story short i think there is an issue with my hdf5 config file but it could also be an issue with vcpkg not installing it correctly.

CMake Error at C:/src/vcpkg/installed/x64-windows-static/share/hdf5/hdf5-config.cmake:150 (include):
  include could not find requested file:

    C:/src/vcpkg/installed/x64-windows/share/hdf5/hdf5-targets.cmake

as you can see, its searching for a file in the dynamic directory.

i think the best thing i can do is ask if my installation is correct. this is my directory of hdf5-static:

packages\hdf5_x64-windows-static
            ├───debug
            │   └───lib
            │       ├───pkgconfig
            │       │   ├───hdf5.pc
            │       │   └───hdf5_hl.pc
            │       ├───libhdf5.settings
            │       ├───libhdf5_D.lib
            │       ├───libhdf5_hl_D.lib
            │       └───libhdf5_tools_D.lib
            ├───include
            │       ├───H5ACpublic.h
            │       ├───H5api_adpt.h H5Apublic.h
            │       ├───H5Cpublic.h
            │       ├───H5DOpublic.h
            │       ├───H5Dpublic.h
            │       ├───H5DSpublic.h
            │       ├───H5Epubgen.h
            │       ├───H5Epublic.h
            │       ├───H5ESdevelop.h
            │       ├───H5ESpublic.h
            │       ├───H5FDcore.h H5FDdevelop.h
            │       ├───H5FDdirect.h
            │       ├───H5FDfamily.h
            │       ├───H5FDhdfs.h
            │       ├───H5FDioc.h
            │       ├───H5FDlog.h
            │       ├───H5FDmirror.h
            │       ├───H5FDmpi.h
            │       ├───H5FDmpio.h
            │       ├───H5FDmulti.h
            │       ├───H5FDonion.h
            │       ├───H5FDpublic.h
            │       ├───H5FDros3.h
            │       ├───H5FDs3comms.h
            │       ├───H5FDsec2.h
            │       ├───H5FDsplitter.h
            │       ├───H5FDstdio.h
            │       ├───H5FDsubfiling.h
            │       ├───H5FDwindows.h
            │       ├───H5Fpublic.h
            │       ├───H5Gpublic.h
            │       ├───H5ldevelop.h
            │       ├───H5IMpublic.h
            │       ├───H5lpublic.h
            │       ├───H5Ldevelop.h
            │       ├───H5LDpublic.h
            │       ├───H5Lpublic.h
            │       ├───H5LTpublic.h
            │       ├───H5MMpublic.h
            │       ├───H5Mpublic.h
            │       ├───H5Opublic.h
            │       ├───H5overflow.h
            │       ├───H5PLextern.h
            │       ├───H5PLpublic.h
            │       ├───H5Ppublic.h
            │       ├───H5PTpublic.h
            │       ├───H5pubconf.h
            │       ├───hH5public.h
            │       ├───H5Rpublic.h
            │       ├───H5Spublic.h
            │       ├───H5TBpublic.h
            │       ├───H5Tdevelop.h
            │       ├───H5Tpublic.h
            │       ├───H5TSdevelop.h
            │       ├───hH5version.h
            │       ├───H5VLconnector.h
            │       ├───H5VLconnector_passthru.h
            │       ├───H5VLnative.h
            │       ├───H5VLpassthru.h
            │       ├───H5VLpublic.h
            │       ├───H5Zdevelop.h
            │       ├───H5Zpublic.h
            │       ├───hdf5.h
            │       └───hdf5_hl.h
            ├───lib
            │   ├───pkgconfig
            │   │      ├───hdf5.pc
            │   │      └───hdf5_hl.pc
            │   ├───libhdf5.lib
            │   ├───libhdf5.settings
            │   ├───libhdf5_hl.lib
            │   └───libhdf5_tools.lib
            ├───share
            │   └───hdf5
            │       ├───data
            │       │   ├───RELEASE.txt
            │       │   ├───USING_HDF5_CMake.txt
            │       │   └───USING_HDF5_VS.txt
            │       ├───copyright
            │       ├───hdf5-config.cmake
            │       ├───hdf5-config-version.cmake
            │       ├───hdf5-targets.cmake
            │       ├───hdf5-targets-debug.cmake
            │       ├───hdf5-targets-release.cmake
            │       ├───vcpkg.spdx.json
            │       ├───vcpkg_abi_info.txt
            │       └───vcpkg-cmake-wrapper.cmake
            └───tools
                    └───hdf5
                        ├───gif2h5.exe
                        ├───h5clear.exe
                        ├───h5copy.exe
                        ├───h5debug.exe
                        ├───h5delete.exe
                        ├───h5diff.exe
                        ├───h5dump.exe
                        ├───h5format_convert.exe
                        ├───h5import.exe
                        ├───h5jam.exe
                        ├───h5ls.exe
                        ├───h5mkgrp.exe
                        ├───h5perf_serial.exe
                        ├───h5repack.exe
                        ├───h5repart.exe
                        ├───h5stat.exe
                        ├───h5unjam.exe
                        ├───h5watch.exe
                        └───h52gif.exe

I link all files in question down bellow (i had to change vcpkg.cmake to a .txt file since github does not accept cmake files) cmakelists.txt vcpkg.cmake.txt hdf5-config.cmake.txt

i think the issue is most likely cmake and not vcpkg.

thanks for your help anyway.

github-actions[bot] commented 1 year ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.