summaryrefslogtreecommitdiff
path: root/Auxiliary/bash-completion
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-21 08:27:02 -0400
committerBrad King <brad.king@kitware.com>2020-07-21 08:34:30 -0400
commit83bc79e2326247c4a73608c6c9723a8bd398cf96 (patch)
tree775ba23179d7cf7582d32eff53ab57454099ff7d /Auxiliary/bash-completion
parentd421274e3e11a0e6480358faa8a8e5cf48d7b3c2 (diff)
downloadcmake-83bc79e2326247c4a73608c6c9723a8bd398cf96.tar.gz
Auxiliary: Add options to control Vim and Emacs file installation
Since commit 2642f432ef (Aux: Install editor and bash files to more natural locations, 2020-03-30, v3.18.0-rc1~429^2) these files are installed by default into locations that are not CMake-specific but may be distro-specific. Add options for packagers to control these locations. Also rename the `CMAKE_BASH_COMP_DIR` option to follow our conventions. Fixes: #20993
Diffstat (limited to 'Auxiliary/bash-completion')
-rw-r--r--Auxiliary/bash-completion/CMakeLists.txt17
1 files changed, 11 insertions, 6 deletions
diff --git a/Auxiliary/bash-completion/CMakeLists.txt b/Auxiliary/bash-completion/CMakeLists.txt
index 06d22c238b..93b6ffd0e3 100644
--- a/Auxiliary/bash-completion/CMakeLists.txt
+++ b/Auxiliary/bash-completion/CMakeLists.txt
@@ -6,11 +6,16 @@
# with) as well as a simple installation by a local user into their home
# directory *if* the prefix is `$HOME/.local` since `.local/share/` is part of
# the bash-completion search path too.
-# For more complex installations, packagers can set CMAKE_BASH_COMP_DIR to
-# another system location.
+# For more complex installations, packagers can set CMake_INSTALL_BASH_COMP_DIR
+# to another system location.
-set(CMAKE_BASH_COMP_DIR_DEFAULT ${CMAKE_XDGDATA_DIR}/bash-completion/completions)
-if (NOT CMAKE_BASH_COMP_DIR)
- set(CMAKE_BASH_COMP_DIR "${CMAKE_BASH_COMP_DIR_DEFAULT}")
+if(NOT CMake_INSTALL_BASH_COMP_DIR)
+ if(CMAKE_BASH_COMP_DIR)
+ # Honor previous customization option.
+ set(CMake_INSTALL_BASH_COMP_DIR "${CMAKE_BASH_COMP_DIR}")
+ else()
+ # Default.
+ set(CMake_INSTALL_BASH_COMP_DIR ${CMAKE_XDGDATA_DIR}/bash-completion/completions)
+ endif()
endif()
-install(FILES cmake cpack ctest DESTINATION ${CMAKE_BASH_COMP_DIR})
+install(FILES cmake cpack ctest DESTINATION ${CMake_INSTALL_BASH_COMP_DIR})