Skip to content

Symlink install does not respect destination defaults #559

Open
@cottsay

Description

@cottsay

Given a CMake installation which doesn't specify any destination arguments like this:

install(TARGETS testpkg)

CMake will determine the installation locations based on certain variables and eventually fall back to a static default.

When we symlink install, these default locations are not respected at all resulting in installation directly to the prefix directory.

Expected:

-- Symlinking: install/testpkg/lib/libtestpkg.so.1.2.3
-- Symlinking: install/testpkg/lib/libtestpkg.so.1
-- Symlinking: install/testpkg/lib/libtestpkg.so
-- Symlinking: install/testpkg/lib/libtestpkgstatic.a
-- Symlinking: install/testpkg/bin/testpkg

Actual:

-- Symlinking: install/testpkg//libtestpkg.so.1.2.3
-- Symlinking: install/testpkg//libtestpkg.so.1
-- Symlinking: install/testpkg//libtestpkg.so
-- Symlinking: install/testpkg//libtestpkgstatic.a
-- Symlinking: install/testpkg//testpkg

The logic for determining the installation destination would need to be added to ament_cmake_symlink_install_targets.cmake because ament_cmake_symlink_install.cmake.in is run as a script which doesn't have the variables needed to determine the default locations.

The most simple workaround is to specify destination locations explicitly:

install(TARGETS testpkg
  ARCHIVE DESTINATION lib
  LIBRARY DESTINATION lib
  RUNTIME DESTINATION bin
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogbugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions