microsoft / vcpkg

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

[octomap] cmake config has wrong _LIBRARIES information #30273

Open Neumann-A opened 1 year ago

Neumann-A commented 1 year ago
set(OCTOMAP_LIBRARIES
  "${PACKAGE_PREFIX_DIR}/lib/octomap.lib"
  "${PACKAGE_PREFIX_DIR}/lib/octomath.lib"
)

Either patch that out or redirect to the targets octomap, octomath instead. An alternative could also be to inject a generator expression but the target approach is probably easier to do.

JonLiu1993 commented 1 year ago

@Neumann-A, Thanks for posting this issue, could you please describe in detail the reasons for the _LIBRARIES information error? I installed octomap locally, and checked the location of these two libs, and tested that its usage is correct, forgive me for not understanding what you mean

JonLiu1993 commented 1 year ago

@Neumann-A, Could you explain to me your purpose of this issue in detail? I don't quite understand what you mean by this issue. Thanks.

Neumann-A commented 1 year ago

Libraries variables have to point to debug and release versions either via generator expressions or debug/optimzed keywords. It is the same reason that all those vcpkg-cmake-wrappers exist to fix cmake modules. Normally fixing configs is not necessary due to exporting targets however in this case upstream decides to do it in its own way and export a hardcoded variable.

jimwang118 commented 1 year ago

Are you saying that I should redirectoctomap and octomath in the wrapper file like the following method?

find_package(unofficial-angle CONFIG)
    if(TARGET unofficial::angle::libEGL)
        set(EGL_LIBRARY unofficial::angle::libEGL)
        if(NOT TARGET EGL::EGL)
            add_library(EGL::EGL INTERFACE IMPORTED)
            set_target_properties(EGL::EGL PROPERTIES
                INTERFACE_LINK_LIBRARIES unofficial::angle::libEGL
            )
        endif()
    endif()
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 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

github-actions[bot] commented 6 months ago

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

github-actions[bot] commented 1 day ago

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