Skip to content

docs(README): external install tip improvements #1415

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ A. [ Disclaimer: Here, how to make the completion code visible to
`bash-completion-config-version.cmake` files. Example usage:

```cmake
include(GNUInstallDirs)
find_package(bash-completion)
if(BASH_COMPLETION_FOUND)
message(STATUS
"Using bash completion dir ${BASH_COMPLETION_COMPLETIONSDIR}")
else()
include(GNUInstallDirs)
Comment on lines -210 to +215
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fairly cosmetic I suppose and I don't know if it actually works, but would make sense to me. It's a separate commit we can remove if it doesn't.

Copy link
Collaborator

@akinomyoga akinomyoga Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't use cmake, so I'm not familiar with it. AI says it works, and AI is probably right, but I'm not sure whether there is anything that we should be careful with. I think the original author @jtojnar should know this better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe conditional imports are fine in CMake should probably work. Though, in practice, it should be used elsewhere in the CMake script too.

set (BASH_COMPLETION_COMPLETIONSDIR "${CMAKE_INSTALL_DATADIR}/bash-completion/completions")
message (STATUS
"Using fallback bash completion dir ${BASH_COMPLETION_COMPLETIONSDIR}")
Expand All @@ -234,14 +234,15 @@ A. [ Disclaimer: Here, how to make the completion code visible to
Example for `Makefile.am`:

```makefile
bashcompdir = $(datarootdir)/bash-completion/completions
bashcompdir = $(datadir)/bash-completion/completions
dist_bashcomp_DATA = your-completion-file
```

Example for `CMakeLists.txt`:

```cmake
install(FILES your-completion-file DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/bash-completion/completions")
include(GNUInstallDirs)
install(FILES your-completion-file DESTINATION "${CMAKE_INSTALL_DATADIR}/bash-completion/completions")
```

**Q. When completing on a symlink to a directory, bash does not append
Expand Down