CMakeLists.txt 932 B

12345678910111213141516
  1. # We need to integrate into the system install, or this will silently fail to
  2. # accomplish anything at all, and packagers won't even know it exists. Use the
  3. # `<sharedir>/bash-completion/completions/` hierarchy by default, rooted in
  4. # CMake's XDGDATA_DIR definition of the sharedir. This works with installation
  5. # to `/usr` or `/usr/local` (or any prefix which bash-completion is configured
  6. # with) as well as a simple installation by a local user into their home
  7. # directory *if* the prefix is `$HOME/.local` since `.local/share/` is part of
  8. # the bash-completion search path too.
  9. # For more complex installations, packagers can set CMAKE_BASH_COMP_DIR to
  10. # another system location.
  11. set(CMAKE_BASH_COMP_DIR_DEFAULT ${CMAKE_XDGDATA_DIR}/bash-completion/completions)
  12. if (NOT CMAKE_BASH_COMP_DIR)
  13. set(CMAKE_BASH_COMP_DIR "${CMAKE_BASH_COMP_DIR_DEFAULT}")
  14. endif()
  15. install(FILES cmake cpack ctest DESTINATION ${CMAKE_BASH_COMP_DIR})