Skip to content

[C/C++] CMake: In-tree consumers use different target than external consumers #1531

@ethanmusser

Description

@ethanmusser

CMake builds that include libsbp must link against a different target than those that link against an externally-built libsbp.

Description

In-tree consumers must link against sbp.

swift_add_library(sbp
SOURCES ${libsbp_SRCS}
)

Out-of-tree consumers must link against swiftnav::sbp.

install(
EXPORT sbp-export
DESTINATION ${CMAKE_INSTALL_DATADIR}/libsbp/cmake
NAMESPACE swiftnav::
)

Proposed Solution

Add a library target swiftnav::sbp as an alias for the sbp target.

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