Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symlink install does not respect destination defaults #559

Open
cottsay opened this issue Nov 15, 2024 · 0 comments
Open

Symlink install does not respect destination defaults #559

cottsay opened this issue Nov 15, 2024 · 0 comments
Labels
backlog bug Something isn't working help wanted Extra attention is needed

Comments

@cottsay
Copy link
Contributor

cottsay commented Nov 15, 2024

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
)
@cottsay cottsay added bug Something isn't working help wanted Extra attention is needed backlog labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant