Skip to content

No exported target for msgpack-cpp #901

Open

Description

@wnts

The CMakeLists.txt on the cpp branches does not install exported targets for use with find_package.

This is in contrast with the CMakeLists.txt on the c_master branch

msgpack-c/CMakeLists.txt

Lines 314 to 332 in 4f59b98

CONFIGURE_PACKAGE_CONFIG_FILE (msgpack-config.cmake.in
msgpack-config.cmake
INSTALL_DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
)
INSTALL (EXPORT msgpack-targets
FILE
msgpack-targets.cmake
DESTINATION
"${CMAKE_INSTALL_CMAKEDIR}"
)
INSTALL (
FILES
"${CMAKE_CURRENT_BINARY_DIR}/msgpack-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/msgpack-config-version.cmake"
DESTINATION
"${CMAKE_INSTALL_CMAKEDIR}"
)

Activity

  1. redboltz commented on Jul 14, 2020

    @redboltz
    Contributor

    Thanks you for reporting the issue. @ygj6, could you check this?

  2. ygj6 commented on Jul 16, 2020

    @ygj6
    Collaborator

    Exporting targets is to generate configuration files which used by find_package(). However, msgpack_cpp is a header-only library that cannot be processed by find_package(), so there is no need to export targets.

  3. wnts commented on Jul 22, 2020

    @wnts
    Author

    Providing a package configuration file with an exported target for header-only libraries is stil possible through INTERFACE libraries. (and provides for easy use of the library: finding correct include directory (if not installed to standard system prefix or include directories), propagate transitive dependencies, setting compiler options, etc...):

    Usage:

    project(SomeMsgpackCxxProject CXX)
    
    find_package(msgpackcxx REQUIRED)
    
    add_executable(${PROJECT_NAME} main.cpp)
    target_link_libraries(${PROJECT_NAME} msgpackcxx)

    I will set up a draft pull request with a preliminary proposal.

  4. added a commit that references this issue on Jul 22, 2020
    6c18342
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions